Maps implementation

Hello!
I’m working on Windows with Corona simulator of version 840

I wrote this code:

myMap = native.newMapView( _W/5, 0, _W - _W/3, _H )

and it is works without any errors just with warning about “not supported in a simulator”

Then I wrote this code:
myMap.mapType = “standard”

And I’ve got an error: attempt to index global ‘myMap’ (a nil value)

What is wrong?
[import]uid: 106224 topic_id: 31616 reply_id: 331616[/import]

MapView are not supported by the Corona Simulator, which means the function [lua]newMapView()[/lua] will return [lua]nil[/lua]. Attempting to access a property or function on a nil object will cause a crash.

Check for nil in your code so that your app will work “good enough” in the Corona Simulator. Then build your app for iOS to test out your maps functionality on actual device.

Also, see our sample project “Interface/MapView” that is included with the Corona SDK for an example on how to use our maps API. [import]uid: 32256 topic_id: 31616 reply_id: 126288[/import]

Thanks for your answer!
But I can’t find “Interface/MapView” that is included with the Corona SDK on my PC. There is no Map tutorial on Interface folder. [import]uid: 106224 topic_id: 31616 reply_id: 126400[/import]

Oh I see. You are using the last release version of the Corona SDK, build #894. MapView support was added to Android recently and is only available to paid subscribers via our daily builds (these are early beta versions). It won’t be made available in a trial/release version until later.

Now, if you have a Mac, then you can play with our MapView sample project “today” since it is currently supported on iOS. [import]uid: 32256 topic_id: 31616 reply_id: 126411[/import]

MapView are not supported by the Corona Simulator, which means the function [lua]newMapView()[/lua] will return [lua]nil[/lua]. Attempting to access a property or function on a nil object will cause a crash.

Check for nil in your code so that your app will work “good enough” in the Corona Simulator. Then build your app for iOS to test out your maps functionality on actual device.

Also, see our sample project “Interface/MapView” that is included with the Corona SDK for an example on how to use our maps API. [import]uid: 32256 topic_id: 31616 reply_id: 126288[/import]

Thanks for your answer!
But I can’t find “Interface/MapView” that is included with the Corona SDK on my PC. There is no Map tutorial on Interface folder. [import]uid: 106224 topic_id: 31616 reply_id: 126400[/import]

Oh I see. You are using the last release version of the Corona SDK, build #894. MapView support was added to Android recently and is only available to paid subscribers via our daily builds (these are early beta versions). It won’t be made available in a trial/release version until later.

Now, if you have a Mac, then you can play with our MapView sample project “today” since it is currently supported on iOS. [import]uid: 32256 topic_id: 31616 reply_id: 126411[/import]

“Now, if you have a Mac, then you can play with our MapView sample project “today” since it is currently supported on iOS.”

To play only on device or maps available on Mac’s Corona Simulator too? [import]uid: 106224 topic_id: 31616 reply_id: 126776[/import]

>> To play only on device or maps available on Mac’s Corona Simulator too?

It won’t work in the Corona Simulator, but it will work on iOS. [import]uid: 32256 topic_id: 31616 reply_id: 126839[/import]

“Now, if you have a Mac, then you can play with our MapView sample project “today” since it is currently supported on iOS.”

To play only on device or maps available on Mac’s Corona Simulator too? [import]uid: 106224 topic_id: 31616 reply_id: 126776[/import]

>> To play only on device or maps available on Mac’s Corona Simulator too?

It won’t work in the Corona Simulator, but it will work on iOS. [import]uid: 32256 topic_id: 31616 reply_id: 126839[/import]