Page 1 of 2

Map works on iOS but not on Android. Cannot refresh. map is not initialized

Posted: Wed Mar 04, 2015 11:33 pm
by Bryan Taylor

Anybody see any reason why this works on iOS but not on Android, Android throws up the error: Cannot refresh, map is not initialized in file appery.js, It's a pretty simple page, open map, get your location, center on it, draw the kmz file on it as an overlay, one button to show your current location. everything works perfectly on iOS, but not on Android... stumped now for weeks trying to figure this out... Thanks for any help

Here is the code I am using:

var map;

function initializewestern() {

Code: Select all

 var divs = $("[dsid=western_map]"); 

 if (divs.length) { 

     var mapDiv = divs.eq(0); 

     mapDiv.css("margin", "0"); 

     mapDiv.css("display", "none"); 

     mapDiv.height(mapDiv.parents('[data-role="content"]').height()); 

     mapDiv.css("display", "block"); 

 } 

 var mapOptions = 
 { 
 zoom: 10, 
 }; 

 var map = Appery("map").gmap, mapOptions; 

 var ctaLayer = new google.maps.KmlLayer( 
                                         '[url=http://dl.dropboxusercontent.com/u/31740387/western_only.kmz]http://dl.dropboxusercontent.com/u/31...[/url]', 
                                         {preserveViewport:true} 
                                         ); 

 ctaLayer.setMap(map); 

 google.maps.event.addListener('geolocation_error', function(e) { 
                               alert('There was an error obtaining your position. Message: ' + e.message); 
                               }); 

 google.maps.event.addDomListener(window, 'load', initialize);      

}


Map works on iOS but not on Android. Cannot refresh. map is not initialized

Posted: Thu Mar 05, 2015 6:52 am
by Egor Kotov6832188

Hello Bryan.
Take a look at this tutorial
http://blog.bismallion.com/appery-map...


Map works on iOS but not on Android. Cannot refresh. map is not initialized

Posted: Thu Mar 26, 2015 1:40 pm
by Bryan Taylor

tried that six ways of Sunday, still will not load the kmz files on the map, still getting error map not initialized...
Thanks anyway


Map works on iOS but not on Android. Cannot refresh. map is not initialized

Posted: Thu Mar 26, 2015 10:21 pm
by Bryan Taylor

ok, got the map and kmz drawing, but the map takes up the full screen, the header and footer are not on the page, any ideas on that? the header and footer work fine in ios... not on Android


Map works on iOS but not on Android. Cannot refresh. map is not initialized

Posted: Sat Mar 28, 2015 12:29 pm
by Alena Prykhodko

Hi Bryan,

Please show us screen shot.


Map works on iOS but not on Android. Cannot refresh. map is not initialized

Posted: Sat Mar 28, 2015 12:32 pm
by Bryan Taylor

Here is a screen shot from a galaxy S4Image


Map works on iOS but not on Android. Cannot refresh. map is not initialized

Posted: Sat Mar 28, 2015 12:33 pm
by Bryan Taylor

There should be a button on top "show my location" and a footer with a back button


Map works on iOS but not on Android. Cannot refresh. map is not initialized

Posted: Mon Mar 30, 2015 4:35 pm
by Evgene Karachevtsev

Hello Bryan,

Could you please share your app with the support and tell us its name and steps to reproduce the issue?


Map works on iOS but not on Android. Cannot refresh. map is not initialized

Posted: Sun Apr 05, 2015 4:57 pm
by Bryan Taylor

app name is snowrtrailsnl-android and is shared with support

open the app on an iphone and click one of the four map region buttons and it works properly finds your location, puts the marker on the map and draws the kmz overlay on the map, open it on an android device and the header and footer disappears, it does not find your current location and does not display the marker, it does show the kmz overlay on the map correctly...

It works perfectly in the simulator but not on an actual android device


Map works on iOS but not on Android. Cannot refresh. map is not initialized

Posted: Sun Apr 05, 2015 5:05 pm
by Illya Stepanov

Hi Bryan - We can see SnowTrailsNL-iphone is this it?