mapView - can't get rid of it

I have several functions each calling a different mapView. I have a back button that removes them… is supposed to anyways. I have tried setting the object .isVisible = false, removeSelf() and even = nil and nothing gets rid of the mapView.

Any thoughts? [import]uid: 18783 topic_id: 12606 reply_id: 312606[/import]

I just modified one of the buttons in the MapView sample to remove the map and it worked (build 567).

local button3Release = function( event )  
 myMap:removeSelf() -- remove the map object  
end  

[import]uid: 7559 topic_id: 12606 reply_id: 46126[/import]

I’m using 574 so let me go back a few builds and try again [import]uid: 18783 topic_id: 12606 reply_id: 46128[/import]

Didn’t matter… This may have something to do with CoronaUI list and not directly with the mapView. I am going to try to destroy it by other means. [import]uid: 18783 topic_id: 12606 reply_id: 46132[/import]

[lua]-- creates map for Orlando Office
myMap = native.newMapView( 10, 10, 300, 180 )
myMap.mapType = “normal” – 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 = 385

– Initialize map to a real location, since default location (0,0) is not very interesting
myMap:setCenter( 28.514876, -81.377577 )
myMap:addMarker( 28.514876, -81.377577, { title=“Downtown Office”, subtitle=“25 W. Crystal Lake St Suite 200” } )
myMap.isVisible = false

– function called when back button is pressed coronaui
function soundonPressDowntown(event)
media.playEventSound( “Tock.caf” )
downtownScreen:slideToRight( officeScreen)
downtownImage.isVisible = false
myTextObjectDowntown.isVisible = false
myTextObjectDowntown2.isVisible = false
callButton.isVisible = false
orlandoOffice.isVisible = false
myMap.isVisible = false
myMap:removeSelf()
end

– item selected from xml scroll list made with coronaui
function downtownInfo( item )

if officeScreen then
media.playEventSound( “Tock.caf” )
officeScreen:slideToLeft( downtownScreen )
downtownScreen:addBackButton (soundonPressDowntown)
downtownImage.isVisible = true
myTextObjectDowntown.isVisible = true
myTextObjectDowntown2.isVisible = true
callButton.isVisible = true
transition.to(callButton, {time=1,alpha=1,x=(225),y=(170)})
local isAndroid = “Android” == system.getInfo(“platformName”)
if isAndroid then
orlandoOffice = display.newImage(“orlandooffice-android.png”)
orlandoOffice.x = _W/2; orlandoOffice.y = 385
else
myMap.isVisible = true
end
else

end
end[/lua]
The above code works to display the Map when the downtown office is selected but when the back button is pressed it stays there… if on Android it properly removes the png file and either platform properly removes the other display objects from view when going back. Not sure why the MapView sticks and never goes away.
[import]uid: 18783 topic_id: 12606 reply_id: 46137[/import]

Sorry about posting in an old topic… But i seem to be having the same problem now.

Did you ever happen to resolve this?

I’ve tried removing my map view in every way i can think of and it doesn’t seem to do it consistently. For example i can remove it the first time when i press my back button, but when i go back onto the map page and try to go back again, it doesn’t remove the map.

Very strange… [import]uid: 69826 topic_id: 12606 reply_id: 91675[/import]