On Sep 30, 1:27 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> On Sep 30, 1:20 pm, jameslove <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
> > I need to create a polygon by clicking on the map and also by passing
> > coordinates through a drop down list. Right now I pass the value using
> > a text field and the information appears to pass to the function since
> > the alert shows the correct information. The marker does not appear in
> > the correct spot (Saskatoon ... my place of birth) but rather in
> > Russia. In addition, the marker array seems to be screwd up too.
>
> > Here's a link to the code. I am building on one of the API examples. I
> > may again be missing something basic.
>
> >http://www.bcmetis.ca/idg_polyline.php
>
> If you look at the documentation you will see that GLatLng takes two
> numbers as arguments.  You are passing it a string that looks like
> this: "52.129267,-106.670253".
> You need to call it like this:
> var new_point= new GLatLng(52.129267,-106.670253);
> which means you need to parse the 2 values out of the string and turn
> them into numbers (parseFloat).

Something like this:
  var coordStr = document.getElementById('coordinates').value;
  var coords = coordStr.split(",");
  var new_point= new GLatLng(parseFloat(coords[0]),
parseFloat(coords[1]));

  -- Larry
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to