I'm trying to access a WMS service that holds old maps that are not yet georeferenced. Therefore request must be based on image pixels, not coordinates.
This is the url that Leaflet should produce (it gives a correct tile):
/wms/177?FORMAT=image%2Fpng&STATUS=unwarped&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG%3A4326&BBOX=9.0949470177293e-13,-9.0949470177293e-13,2686.976,2686.976&WIDTH=256&HEIGHT=256However, I'm not able to get Leaflet to produce such bbox. Here is my current attempt:
var map = L.map('map', { maxZoom: 20, minZoom: 2, crs: L.CRS.Simple}).setView([0, 0], 6); var unwarped_image_width = 6708;var unwarped_image_height = 6936;var wms_url = '/maps/wms/177';var southWest = map.unproject([0, 6936], map.getMaxZoom());var northEast = map.unproject([6708, 0], map.getMaxZoom());map.setMaxBounds(new L.LatLngBounds(southWest, northEast));var mywms = L.tileLayer.wms(base_url + wms_url, { format: 'image/png', version: '1.1.1', attribution: "myattribution", status: 'unwarped'});mywms.addTo(map);This gives bbox values between -1 and 1 and server throws internal server error.
If I remove L.CRS.Simple Leaflet gives an extreme close-up of map. This is the url that Leaflet produces:
/wms/177?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&LAYERS=&STYLES=&FORMAT=image%2Fpng&TRANSPARENT=false&HEIGHT=256&WIDTH=256&STATUS=unwarped&SRS=EPSG%3A3857&BBOX=-20037508.342789244,-10018754.171394624,-10018754.171394622,-7.081154551613622e-10
أكثر...
This is the url that Leaflet should produce (it gives a correct tile):
/wms/177?FORMAT=image%2Fpng&STATUS=unwarped&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG%3A4326&BBOX=9.0949470177293e-13,-9.0949470177293e-13,2686.976,2686.976&WIDTH=256&HEIGHT=256However, I'm not able to get Leaflet to produce such bbox. Here is my current attempt:
var map = L.map('map', { maxZoom: 20, minZoom: 2, crs: L.CRS.Simple}).setView([0, 0], 6); var unwarped_image_width = 6708;var unwarped_image_height = 6936;var wms_url = '/maps/wms/177';var southWest = map.unproject([0, 6936], map.getMaxZoom());var northEast = map.unproject([6708, 0], map.getMaxZoom());map.setMaxBounds(new L.LatLngBounds(southWest, northEast));var mywms = L.tileLayer.wms(base_url + wms_url, { format: 'image/png', version: '1.1.1', attribution: "myattribution", status: 'unwarped'});mywms.addTo(map);This gives bbox values between -1 and 1 and server throws internal server error.
If I remove L.CRS.Simple Leaflet gives an extreme close-up of map. This is the url that Leaflet produces:
/wms/177?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&LAYERS=&STYLES=&FORMAT=image%2Fpng&TRANSPARENT=false&HEIGHT=256&WIDTH=256&STATUS=unwarped&SRS=EPSG%3A3857&BBOX=-20037508.342789244,-10018754.171394624,-10018754.171394622,-7.081154551613622e-10
أكثر...