-
-
Save fitomad/bc46251967538519794d0cf8e2c6a28b to your computer and use it in GitHub Desktop.
This file contains 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
venues = JSON.parse("...json document..."); | |
// Annotations | |
let annotations = venues.map(function(venue) { | |
let coordinate = new mapkit.Coordinate(venue.spatial.latitude, venue.spatial.longitude); | |
let options = { | |
url : { | |
1 : "images/venues/" + venue.id + "@1x.png", | |
2 : "images/venues/" + venue.id + "@2x.png", | |
3 : "images/venues/" + venue.id + "@3x.png" | |
}, | |
size : { | |
width : 50, | |
height : 50 | |
}, | |
accessibilityLabel : venue.title | |
}; | |
var annotation = new mapkit.ImageAnnotation(coordinate, options); | |
// Clustering setup | |
annotation.clusteringIdentifier = "AustriasCollectionCluster"; | |
annotation.collisionMode = mapkit.Annotation.CollisionMode.Circle; | |
annotation.displayPriority = mapkit.Annotation.DisplayPriority.High; | |
// Añadimos el Event Listener | |
annotation.addEventListener("select", austriasAnnotationSelected, venue); | |
return annotation; | |
}); | |
map.showItems(annotations); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment