MGRS overlay

I am trying to build MGRS lines above a map in an overlay using OpenLayers (JavaScript). Where I really have problems, you find strange squares (meshes not 100 km / 100 km). Does anyone know where I can find an algorithm to build them?

In particular, the information I have or can find is: Convert Lat / Long to MGRS Convert the full string of MGRS (i.e. 17SLA123678, but not 17SLA) to Lat / Lon Convert Lat / Lon to screen pixel and vice versa

Thanks!

+4
source share
3 answers

I do not know the MGRS system, but the Proj4JS library can be useful. This is used to convert between coordinate systems, so you can configure it to convert from coordsys to pixels or, more often, from one coordsys to another.

It is open source and is widely based on the well-known proj.4 library and interacts with OpenLayers. In fact, OpenLayers uses proj4js to convert between different coordinate systems.

+4
source

You can find http://dhost.info/usngweb/ very useful (enable the "Zones" checkbox)

+4
source

I just added some of these features to https://github.com/jaycrossler/js-maptools (uses Leaflet instead of OpenLayers). He will draw a polygon above the USNG / MGRS cell to make the mouse end.

0
source

All Articles