I am using the native.newMapView() api to show a map. And I am trying to add a marker into the map:
local function addMarker() local function markerListener(event) alert("type: "..event.type..', markerId: '..event.markerId..', lat: '..event.latitude..', long: '..event.longitude) end local markerOpt = { title = "Displayed Title", subtitle = "Subtitle text", listener = markerListener, -- This will look in the resources directory for the image file imageFile = "map\_marker.png", -- Alternatively, this looks in the specified directory for the image file -- imageFile = { filename="someImage.png", baseDir=system.TemporaryDirectory } } local result, errorMessage = myMap:addMarker( currX, currY, markerOpt) if ( result ) then alert( "Marker added" ) else alert( errorMessage ) end end timer.performWithDelay( 30000, addMarker )
The marker didn’t show up at all. I tried to center the map using the same location but still can’t see the market.
I am using corona SDK: 2016.2900 (2016.6.14) and I am testing it on Android device 5.1.1
I also tried on XCode Simulator. The map is not google map and has no marker as well.