Skip to main content

Posts

Showing posts with the label google-maps-api-3

current location needs page refresh in Jquery mobile

i have created an application in jquery and google maps javascript v3 , in which i am displaying a user's current location after a button click. Now the problem is some times i got pretty fine current location and sometimes at the same place its showing my current location miles away but again when i refresh the page i again got the pretty fine current location. does anyone know how to get rid off pressing refresh button again so a user doesn't has to press the refresh on their mobile browser ?? Note: I am testing this application in android phone which has a default browser. Page #1 has a button and Page #2 has a map but the Page #1 and Page #2 are combined in a single jQuery HTML page.

Need to add 45+ points to a google map

trying to add 45 different points to a map, but I just get OVER_QUERY_LIMIT returned, and no map. I am getting locations via a string search, then assigning the returned LatLng object to a new google Marker object String Search var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': x}, function(results, status) { if (status === google.maps.GeocoderStatus.OK) { var result = results[0].geometry.location; return result; } else { alert("Geocode was not successful for the following reason: " + status); } });

Grey boxes appear in parts of embedded Google Map in modal box

I'm having a problem with embedding a Google Map via the v3 API in a modal box. Grey boxes appear in the map canvas when the modal is shown. Resizing the browser window, bringing up Web Inspector, etc. makes all map tiles visible, i.e. it "force re-render" the map. The parent element of the map element ( section#map-modal , see code below) has display: none set in its CSS on page load. The JS modal code automatically sets display: block when the show button is clicked. If I temporarily remove display: none from the modal element, the map renders correctly on page refresh. Isn't the Google Map liking having a hidden parent element? I'm using Twitter's Bootstrap modal jQuery plugin, and am controlling the modal itself with CSS. It's fixed positioned, have a pixel width, etc. Nothing unusual. I've of course googled around for solutions, and many points to the Google API method of triggering the resize event: google.maps.event.trigger(map,