I am having a simple problem that is puzzling me. I draw a Google map and add two buttons. Pressing one button sets myMap.mapType to “satellite” and pressing the other button sets it to “normal”. The intent of this to allow switching between normal and satellite views. I can toggle to satellite view, but I can never toggle back to normal view. Interestingly, the following program works if I substitute “normal” with “hybrid”. It will let me toggle between hybrid and satellite to my hearts content. Is this a bug or must II redraw the map everytime I switch back to normal view?
function main ()
mainMenu ()
end
function mainMenu ()
myMap = native.newMapView( 20, 20, 300, 220 )
if myMap then
myMap.x = display.contentWidth / 2 ; myMap.y = 120
myMap:setCenter( 39.09544 , -84.516037 )
end
mapViewButton = display.newImage ( “mapButton.png” )
mapViewButton.anchorX = 0.0 ; mapViewButton.anchorY = 0.0
mapViewButton.x = 165 ; mapViewButton.y = 235
satelliteViewButton = display.newImage ( “satelliteButton.png” )
satelliteViewButton.anchorX = 0.0 ; satelliteViewButton.anchorY = 0.0
satelliteViewButton.x = 5 ; satelliteViewButton.y = 235
satelliteViewButton : addEventListener ( “tap” , satelliteView )
mapViewButton : addEventListener ( “tap” , mapView )
end
function satelliteView ()
myMap.mapType = “satellite”
end
function mapView ()
myMap.mapType = “normal”
end
main ()