Skip to main content

Posts

Showing posts with the label google-maps

iPhone google maps v3 pans after pinch zoom

I have a problem developing a web application for iPhone. When I visit a simple example like http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/examples/map-simple.html in an iPhone and do pinch zoom the map pans when I release the fingers from the screen. This makes the map end up somewhere else than the place I zoomed to.

Is there a better way to embed maps on the iPhone, without using native code?

I have an iPhone application, which does include maps. However, when a user clicks a button in the app - it just brings up an embedded safari browser, with the Google Maps in it. This is because I have a web version of the app, and I want the exact same result on both iPhone and web, without having to constantly update both codes. Also, it includes display of a polygon and pins. Is there a better way to implement Javascript maps on the iPhone in a native app? Or for Javascript to control a native Google map in the iPhone application? I don't really fancy the idea of "translating" all the Javascript code, database lookup etc, into native code. Any ideas?

MKMapKit Hexagon or Square Overlay

I want to make overlay with hexagon or squares over google map with MKMapKit. Not just one hexagon or square, i want to use google map like a tile based map with full overlay with hexagons in every 1km area. I know app will crash if i do the overlay in one process so i want to do it only on the viewable portion of the screen but in that case i have difficulties to make the distance from the start point, its not getting on the right point or hexagons are not same size everywhere etc. My question: lets think i have 1 thousand hexagons in the viewable portion, so what is the best way to place them with a equal distance at once, how should my calculation ? if i scroll the map, how should i calculate the new start points. or should i give up from hexagon and use another think ? i hope i give you a clue for what i have try to do, any helps, any examples or any ideas are welcome.

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); } });

How to display Google map for city

I am trying to display a Google map when a user searches for a city and presses the search button but I am not getting how to do it properly. Here is my code done so far. Not getting how to take user input and check that city is in array; if yes, then display it on Google map. For example, if user types city name Houston, USA then it should display on Google map after checking if city name is in our database. Script: function searchResult(cityname) { var namesOfCity = ["houston,boston,newyork,florida"]; //check the user input //if match display it on google map } function initialize() { if(GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(37.4419, -122.1419), 13); map.setUIToDefault(); } } HTML <body onload="initialize()" onunload="GUnload()"> <input type="text" id="cityname" value="

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,