Hi Guys:
Thanks in advance.
I am adding a native mapview in my project, but it run in to 3 problems:
(build .2393 for iOS device)
- some times the app crash and quit to desktop when I deleting the mapview. (on iPhone5)
The chance is about 1 crash out of 100. But this only happens during the first few usage when I restart the app. After few times, it become stable.
- Each time I add a new mapview and set center, those error message showed in the xCode organizer’s console
The App works normally, but I am worried that apple may reject the app because of this warning message.
"Sep 15 21:42:39 My name here-iPhone geod[115] \<Warning\>: Can't get bundle identifier for process 53" "Sep 15 21:42:39 My name here-iPhone geod[115] \<Warning\>: Can't get bundle identifier for process 53"
- the Legal button in the bottom left corner is not functional. (It used to work in my another project when I creating a small mapview with older version of the build, but now it’s not working. ) Apple will reject it if it is not working.
things may be easier if I create a map view and move it to the view when I need it, but the mapview will drain battery because of the GPS. (Even I don’t need to get user’s location, but only display a address)
The function to add map view:
function toLargeMap (event) if myMap2 then if myMap2.x ~= nil then myMap2:removeSelf() mpMap2 = nil end end myMap2 = native.newMapView( ax, ay+26, 310 , 506 ) if myMap2 then self.view:insert(myMap2) myMap2.mapType = "normal" local st2 = infoA[s1trueCG][3]..", "..infoA[s1trueCG][4] print (st2) local mapLocationHandler = function( event ) if event.isError then native.showAlert( "Error", event.errorMessage, { "OK" } ) else myMap2:setCenter( event.latitude, event.longitude, false ) local markerTitle = infoA[s1trueCG][2] local options = { title = markerTitle, subtitle = st2, --listener = markerListener, } myMap2:addMarker( event.latitude, event.longitude, options) end end myMap2:requestLocation( st2, mapLocationHandler ) end end
The function to remove it:
( myMap2 ~= nil will return false on Mac, but it return true on device, so I use myMap2.x to check if it is nil)
function MapBackBtHandler (event) print ("map zoom out") if myMap2 then if myMap2.x ~= nil then myMap2.x = 800 myMap2:removeSelf() myMap2 = nil end end end
Thank you,