svenkapudija
svenkapudija

Reputation: 5166

Convert Google Maps coordinates to pixels

I have simple list of Google Maps coordinates (range 44-46 lat. and 15-17 lon.) and I have a screen size 1280x720. How can I translate those coordinates (bunch of them) in this screen size so actually my top edge of the screen would respresent 46.000000, lower edge 44.000000, left edge 15.000000 and right edge 17.000000.

Upvotes: 1

Views: 1317

Answers (1)

Axel Fontaine
Axel Fontaine

Reputation: 35179

Keep it simple.

Map 2 longitude degrees to 1280 pixels = 640 pixels / longitude degree

Map 2 latitude degrees to 720 pixels = 360 pixels /latitude degree

The rest is simple math.

Upvotes: 1

Related Questions