MapKit JS how to update existing map with new markerAnnotations ?

I have a map with few MarkerAnnotations. Now i need to add some more depending on some user action. I have a few questions regarding that. (I am using ReactJS)
  • How can I make a method to add more pins (and delete them) to existing map

  • Is there a way only to create a map and not show it

Hi!

MapKit JS is a JavaScript library, you will most likely need to create a React element to wrap it in order to pass in map states as props from the React app. Please pay attention to the mapkit.Map lifecycles and don't re-create a new map (or new annotation instances for the same props) every time React calls into render()!

The specific methods and properties you are looking for to add/remove annotations are "Annotating the Map" features on the mapkit.Map class.
Thank you for your answer, it helped me a lot. I have another two problems that keep me stuck for days:
  • I added annotations and callouts. On annotation click, there is a bubble with text, but the animation baloon transforms into a dot. Is there a way to make the annotation baloon just a little bigger ( like when there is no callout ) and to show the bubble above ?

  • Sometimes when exiting the screen and coming back, there is a message in my console :

" [MapKit] mapkit.init(): already initialized; ignoring. " ,

and the map is not shown. What does it mean and how to fix it.

Thank you !

MapKit JS how to update existing map with new markerAnnotations ?
 
 
Q