9

I'm not very skilled within the GIS world, however, I would like to know if it's possible to use this map:

http://wfs-kbhkort.kk.dk/k101/wms?service=WMS&version=1.1.0&request=GetMap&layers=k101:theme-startkort&styles=&bbox=12.451709828167994,55.63150896601625,12.64714535243575,55.72503797474024&width=512&height=495&srs=EPSG:4326&format=application/openlayers

within leaflet?

I've looked at the API for leaflet and can see that it is possible to use custom maps/tiles with the tileLayer option. However, I cannot get it to work.

Can someone point me in the right direction?

1 Answer 1

23

Take a look at L.tilelayer.wms in the API.

In your case you should get something like this:

var map = L.map('map').setView([55.67, 12.60], 11);

var mywms = L.tileLayer.wms("http://wfs-kbhkort.kk.dk/k101/wms", {
    layers: 'k101:theme-startkort',
    format: 'image/png',
    transparent: true,
    version: '1.1.0',
    attribution: "myattribution"
});
mywms.addTo(map);
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.