I’m a newbie of Corona… I’m trying to create an app that uses google maps, so i found the code below to import a map, but on the console appears the message: WARNING: Map views are not supported in the simulator. Please build for device. and obviously i can’t see the map imported on the Simulator screen. How can i see the map on the simulator screen? Thanks
local myMap myMap = native.newMapView( 20, 20, 300, 220 ) myMap.mapType = "standard" -- other mapType options are "satellite" or "hybrid" -- The MapView is just another Corona display object, and can be moved or rotated, etc. myMap.x = display.contentWidth / 2 myMap.y = 120 -- Initialize map to a real location, since default location (0,0) is not very interesting myMap:setCenter( 37.331692, -122.030456 ) local function callMap() -- Fetch the user's current location -- Note: in XCode Simulator, the current location defaults to Apple headquarters in Cupertino, CA local currentLocation = myMap:getUserLocation() if currentLocation then -- Move map so that current location is at the center local currentLatitude = currentLocation.latitude local currentLongitude = currentLocation.longitude myMap:setCenter( currentLatitude, currentLongitude, true ) -- Look up nearest address to this location (this is returned as a "mapAddress" event, handled above) myMap:nearestAddress( currentLatitude, currentLongitude ) end end -- A function to handle the "mapAddress" event (also known as "reverse geocoding") -- local mapAddressHandler = function( event ) local locationText = "Latitude: " .. currentLatitude .. ", Longitude: " .. currentLongitude .. ", Address: " .. event.streetDetail .. " " .. event.street .. ", " .. event.city .. ", " .. event.region .. ", " .. event.country .. ", " .. event.postalCode local alert = native.showAlert( "You Are Here", locationText, { "OK" } ) end -- A listener for the address lookup result -- (This could also be a table listener on the map itself, in case you have more than one simultaneous map.) Runtime:addEventListener( "mapAddress", mapAddressHandler ) timer.performWithDelay( 1000, callMap ) -- get current location after 1 second