Hi,
I’m trying to turn on GPS when the app start up to get user location, then turn GPS off.
However, the map seem to be disabled, but the GPS indicator (the arrow icon on iPhone status bar) still there.
Even if I use simple:
myMap = native.newMapView( 0, 0, 50, 50 )
myMap:removeSelf()
Any help would be very appreciated.
below is my detail code:
[lua]mapAddressHandler = function( event )
sAccuracy = event.accuracy
sGPS = --event.Latitude …
–"|" … event.Longitude …"|"…
event.streetDetail … “|” … event.street …
“|” … event.city …
“|” … event.region …
“|” … event.country …
“|” … event.postalCode
sCity = event.city
sRegion = event.region
sCountry = event.country
end
myMap = native.newMapView( 0, 0, 50, 50 )
Runtime:addEventListener( “mapAddress”, mapAddressHandler )
function getmapaddr( )
myLocation = myMap:getUserLocation()
myMap:setCenter( myLocation.latitude, myLocation.longitude, false )
myMap:nearestAddress( myLocation.latitude, myLocation.longitude )
end
function removemaplistener( )
Runtime:removeEventListener( “mapAddress”, mapAddressHandler )
myMap:removeSelf()
end
myMap = native.newMapView( 0, 0, 50, 50 )
Runtime:addEventListener( “mapAddress”, mapAddressHandler )
timer.performWithDelay( 2000, getmapaddr )
timer.performWithDelay( 5000, removemaplistener )[/lua] [import]uid: 37671 topic_id: 10061 reply_id: 310061[/import]