heigeo / leaflet.wms

A Leaflet plugin for working with Web Map services, providing: single-tile/untiled/nontiled layers, shared WMS sources, and GetFeatureInfo-powered identify.
http://heigeo.github.io/leaflet.wms/
MIT License
244 stars 135 forks source link

create L.WMS even in AMD? #37

Open sheppard opened 8 years ago

sheppard commented 8 years ago

Currently L.WMS is only assigned when using Leaflet as a global, so you can't do this:

define(['leaflet', 'leaflet.wms'], function(L) {
    var source = L.WMS.source(...);
});

Instead you have to do this:

define(['leaflet', 'leaflet.wms'], function(L, wms) {
    var source = wms.source(...);
});

It might be less confusing (and more consistent with other plugins) to support both options when running in AMD.