Are mapMarkers implemented?

Regarding, https://docs.coronalabs.com/api/event/mapMarker/index.html

This is the code:

local function mapMarkerListener(e)    print("Marker "..e.markerId.." location: "..e.latitude..", "..e.longitude) end ... myMap:addEventListener("mapMarker",mapMarkerListener)

Nothing is output by the listener. I’ve tested in the IOS Simulator and on an Android device.

Is this implemented for IOS or Android?

Hi @henrik5,

Did you implement map markers as outlined in the example here?

https://docs.coronalabs.com/api/type/Map/addMarker.html

Notice that it sets the marker listener as part of the marker add… I don’t believe you can just “globally” set up a listener function for all markers, as you’re trying to do.

Brent

Well, duh! Thanks :slight_smile:

It’s clearly documented - if you look in the right place :wink: Maybe add a sentence and the addMarker link at the mapMarker type page?

Cheers

Will do! (add that to the docs). Thanks for pointing it out.

Brent

Cool, it’s great that you support this!

If someone should stumble upon this post I’d like to say that it’s possible to suppress the bubble by not passing title/subtitle and that there is no way to pass your reference/data to the marker. So if you want to attach data to a marker, you must take the result of addMarker() and store it in a separate table, i.e. table[result]=myData.

Hi @henrik5,

Did you implement map markers as outlined in the example here?

https://docs.coronalabs.com/api/type/Map/addMarker.html

Notice that it sets the marker listener as part of the marker add… I don’t believe you can just “globally” set up a listener function for all markers, as you’re trying to do.

Brent

Well, duh! Thanks :slight_smile:

It’s clearly documented - if you look in the right place :wink: Maybe add a sentence and the addMarker link at the mapMarker type page?

Cheers

Will do! (add that to the docs). Thanks for pointing it out.

Brent

Cool, it’s great that you support this!

If someone should stumble upon this post I’d like to say that it’s possible to suppress the bubble by not passing title/subtitle and that there is no way to pass your reference/data to the marker. So if you want to attach data to a marker, you must take the result of addMarker() and store it in a separate table, i.e. table[result]=myData.