-
-
Save azamsharp/f25e3aefac36b864004e421cfda3dcc4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js"></script> | |
<style> | |
#map { | |
width: 100%; | |
height: 600px; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="map"></div> | |
<script> | |
mapkit.init({ | |
authorizationCallback: function(done) { | |
fetch('/services/jwt') | |
.then(response => response.json()) | |
.then(result => { | |
done(result.token) | |
}) | |
} | |
}); | |
var MarkerAnnotation = mapkit.MarkerAnnotation | |
var sfo = new mapkit.Coordinate(37.616934, -122.383790) | |
var sfoRegion = new mapkit.CoordinateRegion( | |
new mapkit.Coordinate(37.616934, -122.383790), | |
new mapkit.CoordinateSpan(0.167647972, 0.354985255) | |
); | |
var map = new mapkit.Map("map"); | |
var sfoAnnotation = new MarkerAnnotation(sfo, { color: "#f4a56d", title: "SFO", glyphText: "✈️" }); | |
map.showItems([sfoAnnotation]); | |
map.region = sfoRegion; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment