Search code examples
htmlgoogle-mapsgoogle-maps-api-3kml

How to plot latitude and longitude in google map?


I am plotting a location in google map for webpage, I have search the location in google map and copied the longitude and latitude and pasted into the KML file. I got a example KML file,and their longitude and latitude looks very long when I paste those longitude and latitude in google map didnt come up with any location. But it works fine in the website and showed the location in webpage.

-87.89289951324463,41.97881025520548,0
-87.89184808731079,41.97788506340239,0
-87.89150476455688,41.97762983571196,0
-87.8912901878357,41.97750222148314,0
-87.89090394973755,41.977326751500996,0
-87.89047479629517,41.97719913666485,0

But when I replace with the longitude and latitude that I got from google map and it didnt work, it just show the whole earth in map. The longitude and latitude I wanted to plot are

-37.806606,144.962063,0
37.806055,144.957139,0
-37.805334,144.955969,0
-37.804224,144.956152,0

I am following this tutorial from Google map and example code only changing the latitude and longitude doesnt work, but it is fine with original latitude and longitude.

https://developers.google.com/maps/documentation/javascript/examples/layer-kml


Solution

  • As someone mentioned in the comment, you miss place Longitude,Latitude wrong way. It should be

    144.962063,-37.806606,0