Projection Noob

28 views
Skip to first unread message

Jason Ho

unread,
Apr 25, 2014, 6:25:21 PM4/25/14
to leaflet-ve...@googlegroups.com
Hi Guys

Apologies if this is the wrong section to post...Very new to GIS, and I'm still trying to wrap my head around this whole "projection" concept. I'm trying to display one of our school district maps on the web using Leaflet (which from what I can gather when I load it into Geoserver is EPSG:3347). I'm able to get the image coming up as attached in the "Leaflet screenshot" However it's as though it's "rotated" from what it should be. I've tried using Proj4Leaflet to create a CRS mapping/transformation to EPSG:3347 but it still appears that the map comes out "rotated". I'm able to get it projected in EPSG:3347 when I try and do the example in Openlayers 3 (screenshot also attached to show what it should look like .. just ignore the color difference on this one).

Any ideas?

This is the code snippet I'm trying to use.

var crs = new L.Proj.CRS('EPSG:3347',
                '+proj=lcc +lat_1=49 +lat_2=77 +lat_0=63.390675 +lon_0=-91.86666666666666 +x_0=6200000 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs',
                {
                    resolutions: [
                        8192, 4096, 2048, 1024, 512, 256, 128,
                        64, 32, 16, 8, 4, 2, 1, 0.5
                    ],
                    origin: [0, 0]
                })

console.log(crs);

                counties = new L.TileLayer.WMS("http://localhost:8080/geoserver/elementary/wms", {
                    layers: "elementary:BURNEL05",
                    style: "JasonTest",                   
                    format: 'image/png',
                    transparent: true,                       
                    attribution: "Baragar test map"
                });
                map = new L.Map('map', {
                    center: new L.LatLng(39.511, 175.204),
                    zoom: 12,
                    zoomAnimation: true,
                    fadeAnimation: true,
                    srs: crs,
                    layers: [counties],
                    zoomControl: true
                });
leaflet.PNG
ol3.PNG
Reply all
Reply to author
Forward
0 new messages