Page 1 of 2

Google maps trouble on iphone.

Posted: Mon Dec 09, 2013 7:41 pm
by Michael Martinez

My google map on iphone seems to be in a weird reload cycle. It flickers badly, and sometimes it doesn't even display on the page. As it stands right now, it isn't even usable. The problem exists on android too, but it is MUCH better on android than it is on the iphone. On android it flickers briefly, but it doesn't crash the app and is still usable. On my dev machine, everything works fine.

The project is already shared with support. I'd be very grateful if you guys can help.

My google maps code in its entirety: (I don't believe this to be the problem).

Code: Select all

 var mapElement; 
 var mapOptions; 
 var map; 
 var presentLocation; 
 var bodyicon = Appery.getImagePath('crimescene.png'); 
 var policeicon = Appery.getImagePath('police.png'); 
 var personicon = Appery.getImagePath('male-2.png'); 
 function initialize()  
 { 
     console.log('building map.') 
     presentLocation = getPresentLocation(); 

     var mapOptions = { 
       zoom: 12, 
       center: presentLocation, 
       mapTypeId: google.maps.MapTypeId.ROADMAP 
     }; 

     map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); 

     var marker = new google.maps.Marker(    { position: presentLocation, map: map, title:'You are Here.', icon:personicon }); 
     //var marker = new google.maps.Marker(    { position: presentLocation, map: map, title:'Your body is Here.', icon:bodyicon }); 

     var request = { 
       location: presentLocation, 
       radius: 20000, 
       types: ['police'] 
     }; 

     var service = new google.maps.places.PlacesService(map); 
     service.nearbySearch(request,   function callback(results, status) 
                                     { 
                                         if (status == google.maps.places.PlacesServiceStatus.OK)  
                                         { 
                                             //console.log('Police Stations:', results) 
                                             results.forEach(    function(element, i) 
                                                                 { 
                                                                     //console.log('Creating marker for [' + i + ']', element ) 
                                                                     createMarker(element); 
                                                                 }); 
                                         } 
                                     }); 

     console.log('done.'); 
 } 

 function createMarker(place)  
 { 
     //console.log(place); 
     if(typeof(place) == 'undefined') return; 

     var placeLoc = place.geometry.location; 
     var info = place.name; 
     var marker = new google.maps.Marker( { map: map, position: place.geometry.location, icon:policeicon, title:info } ); 
     google.maps.event.addListener 
     ( 
         marker,  
         'click',  
         function()  
         {   infowindow.setContent(place.name);  
             infowindow.open(map, this);  
         }  
     ); 
 } 

 function getPresentLocation() 
 { 
     var lat = localStorage['localLat']; 
     var lng = localStorage['localLong']; 
     return new google.maps.LatLng(lat,lng); 
 }

Google maps trouble on iphone.

Posted: Mon Dec 09, 2013 7:45 pm
by Maryna Brodina

Hello! Could you clarify what iOS/Android versions are on your devices? Also tell us your app name.


Google maps trouble on iphone.

Posted: Mon Dec 09, 2013 7:49 pm
by Michael Martinez

The app is secret chaperone. the adroid version I am testing against is 4.1, and the ios version is 6.


Google maps trouble on iphone.

Posted: Mon Dec 09, 2013 7:54 pm
by Maryna Brodina

What are the steps to reproduce?


Google maps trouble on iphone.

Posted: Mon Dec 09, 2013 7:58 pm
by Michael Martinez

You just need to log in... I can send you some credentials? Should I send to a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a?


Google maps trouble on iphone.

Posted: Mon Dec 09, 2013 8:02 pm
by Michael Martinez

(that's done too.) I can send to a different email if neccessary.


Google maps trouble on iphone.

Posted: Mon Dec 09, 2013 8:05 pm
by Maryna Brodina

Thank you! I've registered already. How can I get to the screen with map?


Google maps trouble on iphone.

Posted: Mon Dec 09, 2013 8:09 pm
by Michael Martinez

The map is at the bottom of the home screen after you log in. Under the 'Upcoming events' collapsible block.


Google maps trouble on iphone.

Posted: Mon Dec 09, 2013 8:11 pm
by Michael Martinez

If you don't see it, that would of course be part of the problem :)


Google maps trouble on iphone.

Posted: Mon Dec 09, 2013 8:19 pm
by Maryna Brodina

Ok, looks like we don't have that part of problem:) I see it now. We'll test it on devices, but it takes time usually. Someone will get back with update.