Can maps have objects drawn on top?

I’m trying to put objects on top of a native map. I’m using iOs xcode simulator, as corona simulator does not show maps.

I create a square, a native map, a circle.

The circle doesn’t appear in XCode simulator, it does in corona labs, as there is no map. So, I reinsert the square so gets the top z-index, but the map is still on top.

I want to be able to put sprites on top of map, move them, etc. Is this even doable in Corona?

Sample code.

[lua]local mySquare = display.newRect( 280, 250, 40, 80 )
mySquare:setFillColor( 0, 128, 0 )

local myMap = native.newMapView( 10, 10, 460, 300 )

myMap.mapType = “satellite”
myMap.setCenter( 10, 15 )

– circle doesn’t even appear
local myCircle = display.newCircle( 300, 300, 30 )
myCircle:setFillColor( 128, 128, 128 )
myCircle.strokeWidth = 5
myCircle:setStrokeColor(128,0,0)

– make sure objects are on z-top
myCircle.parent:insert(myCircle)
mySquare.parent:insert(mySquare)[/lua] [import]uid: 211420 topic_id: 35046 reply_id: 335046[/import]

Hi @brucehumphrey,
It’s not possible to draw display objects over native display objects, which of course include maps… sorry for the inconvenience.

Brent [import]uid: 200026 topic_id: 35046 reply_id: 139366[/import]

Thanks a lot for the answer!

As I’m liking Corona a lot, I’ll try to see if I can download part of a map and work locally with it as a scrolling background or similar.

The live map thing is doable with a certain popular open source 2D library, you put a transparent layer UI on top of the map, and draw there, but synchronization of the two layers requires quite a bit of work.

Or another option is to use that library for the current project, and Corona for smaller more fun-personal projects. [import]uid: 211420 topic_id: 35046 reply_id: 139391[/import]

Hi @brucehumphrey,
It’s not possible to draw display objects over native display objects, which of course include maps… sorry for the inconvenience.

Brent [import]uid: 200026 topic_id: 35046 reply_id: 139366[/import]

Thanks a lot for the answer!

As I’m liking Corona a lot, I’ll try to see if I can download part of a map and work locally with it as a scrolling background or similar.

The live map thing is doable with a certain popular open source 2D library, you put a transparent layer UI on top of the map, and draw there, but synchronization of the two layers requires quite a bit of work.

Or another option is to use that library for the current project, and Corona for smaller more fun-personal projects. [import]uid: 211420 topic_id: 35046 reply_id: 139391[/import]