kartena / Proj4Leaflet

Smooth Proj4js integration with Leaflet.
http://kartena.github.io/Proj4Leaflet/
BSD 2-Clause "Simplified" License
589 stars 173 forks source link

proj4leaflet not working? #153

Closed swillmes closed 6 years ago

swillmes commented 7 years ago

Hi there,

it looks like I don't get this simple task solved for whatever reason...

The objective is to just define a polarstereo projection (EPSG:3413) and have a WMS displayed in the Leaflet map with this CRS. I had it working with openlayers, but I do not succeed in Leaflet. Anyone an idea what the issue could be ... ?


<!DOCTYPE html>
<html>
  <head>
    <title>whatever</title>
    <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.css'/>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.js'></script> 
    <script src="http://rawgithub.com/kartena/Proj4Leaflet/master/lib/proj4-compressed.js"></script>
    <script src='http://rawgithub.com/kartena/Proj4Leaflet/master/src/proj4leaflet.js'></script>
  </head>
  <body>
  <div id='map'; style='height:550px; width:100%'></div>
    <script>

    var crs3413 = new L.Proj.CRS('EPSG:3413',
        '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs'
    );

    var map = L.map('map', {
            crs: crs3413
    });

    var wmsLayer = L.tileLayer.wms('http://www.gebco.net/data_and_products/gebco_web_services/web_map_service/mapserv?', {
        layers: 'GEBCO_LATEST',
        version: '1.1.1',
        format: 'image/png',
        attribution: 'myattribution'
    });

    wmsLayer.addTo(map);

    map.setView([90,0], 2);

    </script>
  </body>
</html>   

Thx ...

pthorin commented 7 years ago

There are some previous issues regarding problems with polar stereo projections, maybe you are facing a similar issue to them? Check out #42, #82, #102, #112, #149.

perliedman commented 6 years ago

I'm going to close this - I think @pthorin's suggestions sum it up.

If you believe this is another issue than the linked above, please:

Not trying to be complicated, but please realize that the time available for maintaining this project is small, and although unfortunate, issues without a clear description or that requires time for us to even understand the problem is likely to be left untouched.