|
Tuesday, December 15, 2015
Conference: FOSS4G North America (FOSS4GNA) 2016, Raleigh, North Carolina
Wednesday, December 9, 2015
Leaflet WMS layer custom projection on fly
For most of the WMS mapping applications the Google Web Mercator (GWM) projection is sufficient. The GWM is default standard for web mapping and widley accepted by Bing, Google, OSM, OpenLayers(default), and Leaflets(default). However some mapping application required custom projection other than Google Mercator projection to display data. Then, how to project/re-project the data other than wms's default projection, GWM.
The following snippet shows the WMS layer custom projection in LEAFLET for Albers equal area and UTM zone 13.
Step 1.
First of all include -
leaflet.js
proj4.js
proj4leaflet.js in following order.
Step 2: Create new Proj4Leaflet CRS
Find your desired custom projection type in http://spatialreference.org/ and punch the the projection variable in the following code snippet.
The following snippet shows the WMS layer custom projection in LEAFLET for Albers equal area and UTM zone 13.
Step 1.
First of all include -
leaflet.js
proj4.js
proj4leaflet.js in following order.
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet-src.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/proj4js/2.0.0/proj4.js"></script>
<script src="http://mapserv.utah.gov/cdn/examples/proj4leaflet.js"></script>
Step 2: Create new Proj4Leaflet CRS
Find your desired custom projection type in http://spatialreference.org/ and punch the the projection variable in the following code snippet.
Subscribe to:
Posts
(
Atom
)