google maps move marker with lat/lng from ajax success returned data

The google.maps.LatLng constructor takes two numbers for arguments. This won’t work: var newLatLang = new google.maps.LatLng(newCoords); You need to convert newCoords into two numbers. Convert String to latlng google maps Convert “[52.43242, 4.43242]” to google LatLng How do I get a pin on Google Maps using location from a variable?

Google Maps API 3 – Custom marker color for default (dot) marker

You can dynamically request icon images from the Google charts api with the urls: http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|FE7569 Which looks like this: the image is 21×34 pixels and the pin tip is at position (10, 34) And you’ll also want a separate shadow image (so that it doesn’t overlap nearby icons): http://chart.apis.google.com/chart?chst=d_map_pin_shadow Which looks like this: the image … Read more

Google Maps V3: Draw German State Polygons?

You want to do something like this? http://www.geocodezip.com/geoxml3_test/v3_FusionTables_query_sidebarF_local.html?country=Germany It uses publicly available data in FusionTables, the Natural Earth Data set. encrypted ID: https://www.google.com/fusiontables/DataSource?docid=19lLpgsKdJRHL2O4fNmJ406ri9JtpIIk8a-AchA numeric ID: https://www.google.com/fusiontables/DataSource?dsrcid=420419 You can style them (color them) as you like. code snippet: // globals var map = null; var infoWindow = null; var geoXml = null; var geoXmlDoc = null; … Read more

Rotating image / marker image on Google map V3

My js class for solving this problem is: var RotateIcon = function(options){ this.options = options || {}; this.rImg = options.img || new Image(); this.rImg.src = this.rImg.src || this.options.url || ”; this.options.width = this.options.width || this.rImg.width || 52; this.options.height = this.options.height || this.rImg.height || 60; var canvas = document.createElement(“canvas”); canvas.width = this.options.width; canvas.height = this.options.height; this.context … Read more

Google Maps: how to get country, state/province/region, city given a lat/long value?

What you are looking for is called reverse geocoding. Google provides a server-side reverse geocoding service through the Google Geocoding API, which you should be able to use for your project. This is how a response to the following request would look like: http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=false Response: { “status”: “OK”, “results”: [ { “types”: [ “street_address” ], … Read more

Google Maps API autocomplete 2nd address fields on same page

You need to hande the two autocomplete inputs. Here is a generalized version of fillInAddress that will handle multiple autocomplete objects with fields with a unique extension (the “2” in your second version of the form): function fillInAddress(autocomplete, unique) { // Get the place details from the autocomplete object. var place = autocomplete.getPlace(); for (var … Read more