Jeeten Parmar
Jeeten Parmar

Reputation: 5757

Allow user to set its location using Google Map and asp.net

I want to show current location of user. After that, I also want to allow user to set its location by using (dragging) marker which will be available there.

It is same as like we add place on Google Map. I know how to display markers but don't have idea about to add location. I tried google but din't find any solution.

I already have Google API which I am using in displaying markers.

For i.e. I am at Latitude 18.9750 and Longitude 72.8258 which is of city Mumbai, India. It will show me my current location when I open page. Now, I also want that I can change its Latitude and Longitude by dragging Marker at another position.

Upvotes: 1

Views: 1558

Answers (1)

user3841709
user3841709

Reputation: 386

I am going to take a shot at helping even though I currently can't test it out myself. Have you tried assigning the latitude and longitude like this...

 var usa = new google.maps.LatLng(37.09024, -95.712891);
 var brasil = new google.maps.LatLng(-14.235004, -51.92528);
 var argentina = new google.maps.LatLng(-38.416097, -63.616672);

The Google API should have a class called something similar to google.maps.LatLng where is should be relatively simple from there to assign your latitude and Longitude.

I used code from here How to set google map marker by latitude and longitude and provide infomation bubble

Upvotes: 1

Related Questions