1

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.

Jeeten Parmar
  • 5,568
  • 15
  • 62
  • 111
  • add location to what? – Dr.Molle Dec 09 '14 at 12:51
  • @Dr.Molle, i.e. I am at some location say at any street of Mumbai, India. I will able to see it in app with marker. Now, I want that i can change location to some another street of Mumbai or any other city, any country by using marker. I hope you got my idea. – Jeeten Parmar Dec 09 '14 at 12:54

1 Answers1

1

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

Community
  • 1
  • 1
user3841709
  • 386
  • 6
  • 28
  • What is user want to change its default location by positioning marker ? – Jeeten Parmar Dec 10 '14 at 06:33
  • Take a look at this similar question where you can retrieve the lat and long on a marker. http://stackoverflow.com/questions/5968559/retrieve-latitude-and-longitude-of-a-draggable-pin-via-google-maps-api-v3 – user3841709 Dec 10 '14 at 13:37
  • I think it will solve my problem for sure. Let me check it once properly. If it solves my problem then i will mark ur reply as answer. :) – Jeeten Parmar Dec 11 '14 at 06:09