javascript - Google Maps Geocoding problem -


I'm playing with Google Maps for the first time and I'm struggling to remove some information about that place. Where is the marker.

I have set an example for you. The problem occurs when I drag the A-node, getGeocode () returns are undefined?

I need to remove the zip code, city and address from the node, when I pull it.

Please see

thanks in advance!

Update

I have edited my code in response - and now I get both addresses (still need to strip it, so I Variable information is available) But for some reasons my direction output is "0" and "1" (array), I really need to change the geocode?

And is it possible to create a click event on the map to add A and B markers (if there is no guideline on loading?) It gets updated!

It comes from:

  var param = i + "@" + new marker [i] .getLatLng (). Y + "," + New Marker [i] .getLatLng (). X;  

This updated portion is:

  GEvent.addListener (new macros [i], "dendend", function () {var points = [ ]; Var (i = 0; i & lt; newMarkers.length; i ++) {var param = i + "@" + New markers [i] .getLatLng (). Y + "," + New marker [i ] .getLatLng () .x; // digit [i] = new marker [i] .getLatLng (); digit. Pash (ultimate); if (! I) {var x = new gqlient geocoder (); x.Token ( Newmakers [0] .getLatLng (), function (address) {if (addresses.Status.code == 200) {var address = addresses.Placemark [0] .address; document.getElementById ("Start"). InnerHTML = address ;}}); X GetLocations (new marker [1] .getLatLng (), function (address) {if (Addresses.Status.code == 200) {Var address = addresses.Placemark [0] .address; Document.getElementById ("end"). InnerHTML = address;}});}} Gdir.loadFromWaypoints (number);} ); The problem here is that the object you are bringing back from your load, Vodmpoint request is populated with all those members who are asking for you onGDirectionsLoad () If you will take a look at your Javascript error log, you will see: 

Error: gdir.getRoute (0). GetStartGeocode () AddressDetails.Country is undefined

Ok, the response from Google Documention, loadFromWaypoints and GClientGeodcoder should be the same.

I took the liberty to do something and it suddenly became clear that the responses are not the same. If you keep an eye out, you can see that I express the GClientGeocoder request and feedback for the first marker and they are very different. Then you need to do some things:

  • Check your responses to ensure that you do not get JavaScript errors for unintended results:

    If (resp in the 'address entry)

  • Make a GClientGeocoder request for each marker point so that the complete address information is received. My sample does this for the first marker.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -