3 ms·
Thanks..I think this points me in the right direction. I suppose what I'm wanting is to have an SVG map that is accurate in some map projection and then just p
by graderjs 4y ago
Thanks..I think this points me in the right direction.
I suppose what I'm wanting is to have an SVG map that is accurate in some map projection and then just plot a given latitude and longitude on it.
I suppose basically what I want is self-hosted simple low resolution map that generally gives you an idea of where you are in the world once you have your latitude and longitude.
I can get my latitude and longitude off my phone but to me those numbers don't mean anything with regards to geography. I just want a simple way to translate it into geography so you know it's mostly accurate for countries..
but obviously it's not a map that includes features like cities or streets or anything like that.
The issue I see with using a maps provider is you need an API key and there's quota limits and there's all kind of things I just want to basically have my own stack and not have to depend on some other service.
- solardev 4y agoYou don't need any API keys or any payments or anything. Just get a "shapefile" or geojson of world countries, like this one: https://datahub.io/core/geo-countries https://datahub.io/core/geo-countries These are vector formats very similar to SVG except with an understanding of geo coordinate systems and projections. Then use openlayers or leaflet to render it in whatever projection you want, using wgs84 as your coordinate reference system. The earth isn't a perfect sphere so you can't just draw a floating grid around a ball and call it a day. The transformation math is complicated. You can look at the mapping engines source code if you want, or just use them. To add blue dot GPS positioning, you'll have to use Javascript to request the browser location or ip geolocation to guess it. Once you get that you can tell the openlayers to zoom to it and draw a dot and tell you which country it's in using by looking at how it intersects the country polygons. All of that is totally free with no API keys or payments. You can self host all of it with no third party connections.