Järkor
Järkor

Reputation: 3

How to get LatLon from a Source page

I want to get the latitude and longitude by means of a "GET" containing these parameters and put them in a function that positions a point on Google Map.

I can not find a way to make this function, latitude and logitud are stored in a database.

Upvotes: 0

Views: 35

Answers (1)

Ryan Burke
Ryan Burke

Reputation: 952

Create a new marker using the lng and lat values from the server and add it to the map.

    var marker = new google.maps.Marker({
        map: map,
        animation: google.maps.Animation.DROP,
        position: new google.maps.LatLng(position.lng, position.lat),
    });

Upvotes: 1

Related Questions