I have circle marker
var myMarker = L.circleMarker(stuSplit,
{ title: 'unselected' })
.bindLabel("Name: " + students[i][j][0]
+ " ReachTime: " + students[i][j][2]);
Now I want to find latitude & Longitude this myMarker.
I was trying myMarker.getLatLng()
but it is not working.
To find a location using its latitude and longitude on any device, just open Google Maps. On your phone or tablet, start the Google Maps app. On a computer, go to Google Maps in a browser. Then enter the latitude and longitude values in the search field — the same one you would ordinarily use to enter an address.
Use the sight line on the top of the aiming beam to align the beam with the North Star. Use the protractor to measure the angle between the beam and the horizon (which is 90º to the plumb line). This angle is your latitude.
Open 'Google Maps': Open maps.google.com in your browser. Click on the search bar: Now click on the search bar at the top left corner. Enter the latitude and coordinates: Now enter the latitude and longitude in Google maps.
The problem does not lie in getLatLng(). This works fine:
var map = L.map('map').setView([55.4411764, 11.7928708], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var stuSplit = L.latLng(55.4411764, 11.7928708);
var myMarker = L.circleMarker(stuSplit,
{ title: 'unselected' })
.addTo(map);
alert(myMarker.getLatLng());
See a working example here:
http://jsfiddle.net/pX2xn/2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With