I am trying to display a PIN image (default or not) on a map.
I am using the build: 2018.3392 and I have a google APIKEY configured for the maps in config.lua
I can not display the PIN image (And without options it should show the default pin).
This is the code (taken from the coronasdk site and modified slightly)
What I can be doing wrong?
-- Map marker listener function local function markerListener(event) print( "type: ", event.type ) -- event type print( "markerId: ", event.markerId ) -- ID of the marker that was touched print( "lat: ", event.latitude ) -- latitude of the marker print( "long: ", event.longitude ) -- longitude of the marker end -- Create a native map view local myMap = native.newMapView( 0, 0, 300, 220 ) myMap.x = display.contentCenterX myMap.y = display.contentCenterY myMap:setRegion( 4.7125902737478,-74.071590273748, 0.01, 0.01, false ) myMap:setCenter( 4.7125902737478,-74.071590273748 ) -- Sometime later (following activation of device location hardware) local options = { title = "Displayed Title", subtitle = "Subtitle text", listener = markerListener, -- This will look in the resources directory for the image file imageFile = "someImage.png", --{ filename = "someImage.png", baseDir = system.ResourcesDirectory }, -- Alternatively, this looks in the specified directory for the image file -- imageFile = { filename="someImage.png", baseDir=system.TemporaryDirectory } } --local result, errorMessage = myMap:addMarker( 4.7125902737478,-74.071590273748, options ) local result, errorMessage = myMap:addMarker( 4.7125902737478,-74.071590273748) if ( result ) then print( "Marker added" ) else print( errorMessage ) end
The result in attached image.
Regards and thanks in advance for your answers,
Solón