OK, I just tested with the mapView sample app, and with a tiny modification, it does the same error / leaves the GPS on during app suspend…
By replacing the mapView sample apps button1Release() function with code to only remove the mapView, the error manifests
[lua]
local button1Release = function( event )
– This finds the location of the submitted string.
– Valid strings include addresses, intersections, and landmarks like “Golden Gate Bridge”, “Eiffel Tower” or “Buckingham Palace”.
– The result is returned in a “mapLocation” event, handled above).
if myMap then
myMap:removeSelf() – CoronaLabs endorsed technique to remove mapViews (or .parent:remove, same effect)
myMap = nil
local newLabel = display.newText( “***Map removed***”, 20, 70, shadow.contentWidth - 10, 0, native.systemFont, 14 )
newLabel.anchorX = 0.0 – TopLeft anchor
newLabel.anchorY = 0.0 – TopLeft anchor
end
end
[/lua]
This produces the same bug (leaves the GPS on during suspend). The original mapView sample code correctly shuts off the GPS when the app is suspended. But once you remove the mapView using the technique above, then suspend the app, the GPS remains on and drains the battery pretty quickly. There’s no way to turn it off at that point, short of terminating the app.
I’ve tried a good 6 hours worth of variations – not removing but only nil’ing the mapView, .parent:remove, etc, etc, and can’t find a workaround that doesn’t cause blinky maps or leave the GPS on during suspend.