Coder Social home page Coder Social logo

mapykit's Introduction

MapyKit - Native Mapy.cz Swift SDK

MapyKit is native Mapy.cz SDK written in Swift. MapyKit uses native MKMapView under the hood, so it's compatible with all your current map code. Out of the box.

This project is currently in early development stage, framework APIs may change over time.

MapyKit example preview

Installation

Carthage

Add following line to your Cartfile:

github "josefdolezal/MapyKit" ~> 0.1.0

Follow the installation guide to correctly link library with your project.

CocoaPods

Add following line to yor Podfile:

pod 'MapyKit', :git => 'https://github.com/josefdolezal/MapyKit.git', '~> 0.1.0'

Once you updated the Podfile, run:

$ pod install

Usage

Once you have downloaded project source, all you have to do is to insert the map view into view hierarchy. The Mapy.cz maps are rendered using MapyView, subclass of MKMapView:

let mapView = MapyView()

view.addSubview(mapView)
mapView.setExtendedMapType(mapType: .touristic)

Since the view is subclass of MKMapView, you can use all API provided by standard map view (e.g. set delegate or use map annotations).

Map types

MapyKit supports multiple map types. The default map type is ExtendedMapType.standard. You can change map type manually using setExtendedMapType(mapType:) method:

mapView.setExtendedMapType(mapType: .touristic)

Supported map types are listed below.

Type Description Preview Number of layers
.standard Standard map view (default) preview 1
.touristic Standard map with highlighted hiking trails preview 1
.winter Map of winter resorts preview 1
.satelite Satelite map (without labels) preview 1
.hybrid Satelite map (with labels) preview 2
.hybridNative Satelite map (with MapKit native labels) N/A 1
.geography Geography map preview 1
.historical Historical map from 19th century preview 1
.textMap Text-only map preview 2
.in100Years Czech Republic in 100 years preview 2

Note that maps with multiple layers may download significant amount of data. Thus, map rendering takes more time and may waste user's mobile data plan. Whenever you can, use map types with single layer. If you need to display satelite map with street labels, use .hybridNative instead of .hybrid.

Example

See working example of MapyKit with customizable map type in Example directory.

License

This repository is licensed under MIT.

mapykit's People

Contributors

josefdolezal avatar janremes avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.