I would like to add this layer to a site I'm working on that uses leaflet:
http://116.240.195.134/vicmapapi/UserGuide.jsp
The API itself is a javascript file based on OpenLayers: http://api.maps.vic.gov.au/vicmapapi/js/vicmapapi.js (I don't know OpenLayers at all, so I'm not really sure what I'm looking at).
Am I able to access the tiles using leaflet? This didn't work:
var map = L.map('map').setView([-37.3, 145.3], 5);
var wms = L.tileLayer.wms("http://api.maps.vic.gov.au/vicmapapi/map/wms", {
LAYERS: 'CARTOGRAPHICAL',
FORMAT: 'image/png',
FIRSTTITLE: false,
transparent: true,
WIDTH:512,
HEIGHT:512,
EXCEPTIONS:"application/vnd.ogc.se_inimage",
SRS:"EPSG:3111"
});
wms.addTo(map);
In particular, it didn't work because the tiles it tried to fetch had URLs like this:
http://api.maps.vic.gov.au/vicmapapi/map/wms?service=WMS&request=GetMap&version=1.1.1&layers=&styles=&format=image/jpeg&transparent=true&height=256&width=256&LAYERS=CARTOGRAPHICAL&FORMAT=image/png&FIRSTTITLE=false&WIDTH=512&HEIGHT=512&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:3111&srs=EPSG:3857&bbox=18785164.071364917,-3757032.814272983,20037508.342789244,-2504688.542848655
instead of:
http://api.maps.vic.gov.au/vicmapapi/map/wms?LAYERS=CARTOGRAPHICAL&FORMAT=image%2Fpng&FIRSTTILE=false&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A3111&BBOX=2327867.7504022,2539132.2495979,2869735.5008043,3081000&WIDTH=512&HEIGHT=512&cache_bbox=2296369.732799%2C2279293.001349%2C2931371.002802%2C2702627.181351
The server then returns error messages like "400: (x + width) is outside of Raster". If I increase WIDTH to 10000, then Apache returns 500 Internal Server error with a complaint about Java heap space. Oops.
So - am I barking up the wrong tree here, or is there a way to do this?