1. Thanks Rossko, feeding LatLng two numbers helped...

    var location = document.getElementById("location").value;
    var lat=location.substr(0,10);
    var lng=location.substr(11);
    var myLatlng = new google.maps.LatLng(lat, lng);

<...>

    <select onchange="MarkerFromDDList()" id="location">
        <option value="None">-</option>
        <option value="56.9607307 24.0783924">Location 1</option>
        <option value="59.9607307 28.0783924">Location 2</option>
    </select>

2. I want to make title of the marker dynamic too. I'm not very good
in javascript... Any idea how to get 'Location 1' or 'Location 2' to
the javascript variable?

var markerTitle = document.getElementById("location").???????


Thanks.

On Jul 10, 11:43 am, Rossko <[email protected]> wrote:
> >     var myLatlng = new google.maps.LatLng(location);
>
> Try feeding LatLng two numbers, instead of one string of digits with
> spaces and commas in it.
>
> >         <option value="56.96073070463192, ...
>
> You can probaby lose about 10 decimal places off of your numbers, that
> one is defined to within a nanometre.  Six places should do for most
> real mapping applications.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to