A [LeafletJS](http://leafletjs.com/) plugin to use [Apple's mapkitJS](https://developer.apple.com/documentation/mapkitjs) basemaps.
npm install leaflet.mapkitmutantA LeafletJS plugin to use Apple's mapkitJS basemaps.
The name comes from GoogleMutant. It's catchy, even if MapkitMutant doesn't use DOM mutation observers.
I do not have any authorization tokens, so there's no live demo for this
(hint hint: somebody please provide me with one). Instead, marvel at this gif:
!Leaflet showing the three different mapkitjs map types
Include the mapkitJS API in your HTML, plus Leaflet:
``html`
Include the MapkitMutant javascript file:
`html`
Then, you can create an instance of L.GridLayer.MapkitMutant on your JS code:
`javascript
var roads = L.mapkitMutant({
// valid values for 'type' are 'default', 'satellite' and 'hybrid'
type: 'hybrid',
authorizationCallback: function(done) {
done("Your authorization token goes here")
},
language: 'en',
// For debugging purposes only. Displays a L.Rectangle on the
// visible bounds ("region") of the mutant.
debugRectangle: false
}).addTo(map);
`
* "I only see a rectangle when zooming out"
This happens because MapkitJS has a very particular behaviour for very low
zoom levels: it will refuse to use the given CoordinateSpan if that would
mean displaying over 180 degrees of longitude or so.
The current workaround is to scale down the size of the MapkitMutant so it overlaps
the region it reports to cover.
In practical terms, this means that users should add minZoom: 3 to their mapsmaxBounds` of the map to something less than 180 degrees of longitude,
(or set the
or any other similar approach). Else, users will not see parts of the map as grey.
* "I want routing, and placename search, and traffic, and streetview"
Nope. this plugin is only for the mapkitjs basemaps. It doesn't provide
routing, nor search, nor POIs. If you want that, consider implementing it
yourself.
Licensed under LGPL3. Because why not. See the LICENSE file for details.