@Ksan, it seems that on Android, we need to use some timer before calling some of the map api. As for pin that sometime were offset, this is a bug with some Android version only. Corona was never able to replicate this on their side. On our Galaxy s3 we can reproduce any time bad marker position.
I have remove useless code from our app and show you how we deal with marker. I don’t know if this what you are looking for. If not, ask, we have been working with map forever
– ************************************************************************
– Update all pins in our map
– ************************************************************************
local function _updatePins()
if scene.googleMap then
– We always center the map based on our first visible pin in our table
scene.googleMap:setCenter( .latitude, .longitude )
– our temporary marker lookup table
scene.googleMarkerTable = {}
– method called when a marker is click on
local function markerListener(event)
classStoryboard.gotoScene( “viewMarkerItem”, { params = { markerItem = scene.googleMarkerTable[event.markerId] } } )
end
– Iterate the tabledata
for itrMarker = 1, #tableData do
local markerOptTbl = {
listener = markerListener,
}
local item = tableData[itrMarker]
local result, errorMessage = scene.googleMap:addMarker( item.latitude, item.longitude, markerOptTbl )
if result then
scene.googleMarkerTable[result] = tableData[itrMarker]
end
end
end
end
– ************************************************************************
– Dispatch the update all pins
– ************************************************************************
function scene:updatePins()
if scene.googleMap then
scene.googleMap:removeAllMarkers()
scene.googleMarkerTable = nil
– On Androit only, it seems that we must introduce a delay between
– calling removeAllMarkers and adding new one.
timer.performWithDelay( gGlobalVar.addMarkerDelay, _updatePins )
end
end
– ************************************************************************
– Create the map view, center the map and adjust the zoom
– ************************************************************************
function scene:createMapView()
scene.googleMap = native.newMapView( x, y, w, h )
if scene.googleMap then
scene.googleMap.anchorX = 0
scene.googleMap.anchorY = 0
scene.googleMap.mapType = “standard”
local gpsMap = gGps
scene.googleMap:setCenter( gpsMap.regCenterLat, gpsMap.regCenterLon )
scene.googleMap:setRegion( gpsMap.regCenterLat, gpsMap.regCenterLon, 0.1, 0.1, false)
end
end