W
W
Worddoc2017-08-21 13:53:48
JavaScript
Worddoc, 2017-08-21 13:53:48

Google Maps Javascript. How to convert lat,lng to north,south,east,west coordinates?

Hello. I create a groundLayout. But there are only lat and lng coordinates. And when creating a goundLayout, you need to specify the coordinates of all 4 sides. How can I convert my values ​​​​to the right ones? Thank you!

var imageBounds = {
    lat: 55.558322,
    lng: 37.556446
};

var historicalOverlay = new google.maps.GroundOverlay('https://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',imageBounds);

historicalOverlay.setMap(map.map);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2017-08-21
@freeExec

And you yourself do not think that you are citing too little source data. It's like there is a side of a rectangle, how to find its perimeter.
You also have image dimensions, width and height. You just have to calculate the pixel size of this image. If it's scientific. And so estimate for yourself where the left border of the picture passes, where the top one, etc. - thus you pull it crookedly, but pull it over the globe :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question