WARNING: Map views are not supported in the simulator

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

You can’t…  That’s what the message is telling you.  Compile the app and put it on a device. 

Yes, I understood the message… I just wanted to know if there’s a way to see the map on the simulator…

The documentation clearly states this:  http://docs.coronalabs.com/api/library/native/newMapView.html

“This function is not supported by the Corona Simulator.”

So you’re probably asking why?  The answer is pretty simple.  Our maps call the operating system’s Map SDK to work.  That is on Apple iOS we call the iOS Map SDK to do the work.  On Android, it’s the Google Maps SDK that’s built into the Android.   Windows and OS-X do not have a Map SDK to use.   When we have an option of making things work in the Simulator, we do.  There are however times where its a) not possible or b) not practical.  

Rob, do you happen to know if maps work on the xCode Simulator or the Android Emulator?  Maybe that can be an option for him.

The Xcode simulator should work. It is even suggested in the code. Personally, I have not tried the Android emulator for this.

You can’t…  That’s what the message is telling you.  Compile the app and put it on a device. 

Yes, I understood the message… I just wanted to know if there’s a way to see the map on the simulator…

The documentation clearly states this:  http://docs.coronalabs.com/api/library/native/newMapView.html

“This function is not supported by the Corona Simulator.”

So you’re probably asking why?  The answer is pretty simple.  Our maps call the operating system’s Map SDK to work.  That is on Apple iOS we call the iOS Map SDK to do the work.  On Android, it’s the Google Maps SDK that’s built into the Android.   Windows and OS-X do not have a Map SDK to use.   When we have an option of making things work in the Simulator, we do.  There are however times where its a) not possible or b) not practical.  

Rob, do you happen to know if maps work on the xCode Simulator or the Android Emulator?  Maybe that can be an option for him.

The Xcode simulator should work. It is even suggested in the code. Personally, I have not tried the Android emulator for this.