Type Event Dispatch chain ▸ Runtime Revision 2017.3060 Keywords mapLocation See also map:requestLocation() map:getUserLocation() mapAddress mapMarker
The mapLocation
event is generated asynchronously in response to calling map:requestLocation() or in response to a tap event on the Map.
On devices, mapLocation
events may be delayed by activation of the device's location hardware. See map:getUserLocation() for details.
This event is not available in the Corona Simulator.
local function mapLocationListener( event ) print( "The tapped location is in: " .. event.latitude .. ", " .. event.longitude ) end -- Create a native map view local myMap = native.newMapView( 20, 20, 300, 220 ) -- Initialize map to a real location since default location (0,0) is not very interesting myMap:setCenter( 37.331692, -122.030456 ) myMap:addEventListener( "mapLocation", mapLocationListener )