AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Mapkit annotation image11/3/2023 Problem is that I want to do is have a different images for each of the annotations. I was able to use a custom image for annotation - works fine. Finally we add source and layer created in previous steps to the style.Very new to xcode and somewhat confused.Next we load the image and register it a style sprite.Then we create the MGLShapeSource with shape being the annotation created in previous step and MGLSymbolStyleLayer to show the shape from the source on the map.The annotation views image is set based on the value of categoryIdNumber which seems to be some variable outside the viewForAnnotation delegate method. ![]() To make your image look crisp on Retina displays, provide URLs to the Retina versions of your asset. ![]() It uses the default red circle for the marker - I'd like to now change that to a custom image from a URL that I host but I'm having trouble updating the example to use a URL. Minimally, all you need to provide is a URL to your asset (such as a PNG or JPEG image). I'm working with MapKit JS for the first time and using the Custom Callout example from the Apple website.
0 Comments
Read More
Leave a Reply. |