Removing "native" mapNewView objects when using "storyboard"

I’m having a problem removing mapNewView objects from the screen when using
storyboard to change scenes. All other objects (e.g. display objects)
are removed from the screen.

I have try the the following to remove the native map objet, but still can’t.

I have declare :

local myMap

[lua]function scene:exitScene(event)
local group = self.view
if myMap then
myMap:removeSelf()
myMap = nil
end
end

if myMap then
myMap.parent:remove(myMap)
myMap = nil
end
[/lua]

please help!

if myMap then myMap:removeSelf() myMap = nil end

This definitely works, my current project uses maps and I call this in my exitScene function.

My guess would be that you have declared “local myMap” at the top of your code, but when you actually create the map you declare it as a local variable again, and so the exitScene function can’t see it.

Thanks Alan

if myMap then myMap:removeSelf() myMap = nil end

This definitely works, my current project uses maps and I call this in my exitScene function.

My guess would be that you have declared “local myMap” at the top of your code, but when you actually create the map you declare it as a local variable again, and so the exitScene function can’t see it.

Thanks Alan