-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wicket-leaflet: add module loader support #121
Conversation
We have no tests for the Leaflet extension. Can you confirm that the standard WKT test cases work under these changes? Thanks! |
No, doesn't work at all. A simple toObject() fails because an object with the interface {x: number, y: number} is passed to leaflets coordsToLatLng method, which expects a coordinate to be passed a as a two element array. But I'm not sure if this issue is related to this pull request. I would assume that at least the leaflet part is completely broken. It would probably be best to have a proper automated test setup for each map provider. |
Maybe I'm not following what's changed in this pull request. The intent with the library-specific extension files:
...Is that they each take care of the translating Wicket's ( We also do have a specific set of tests for one of the map providers, Google Maps, in the following spec:
These are difficult to automate (I currently don't know how) because they require loading external resources in a (headless?) browser. Hence, the Google Maps tests above are not automated. Would love it if someone could find a way to automate them for all providers. |
What the pull request does, is adding the "standard" module loading wrapper as it is already available in wicket.js: (function ( root, factory ) {
if ( typeof exports === 'object' ) {
// CommonJS
factory( require('./wicket') );
} else if ( typeof define === 'function' && define.amd ) {
// AMD. Register as an anonymous module.
define( ['wicket'], factory);
} else {
// Browser globals
factory(root.Wkt);
}
}
(this, function(Wkt) {
[...]
})); I agree this change is not really clear from the github diff page. Regarding the "coordinate translation" issue: I think currently the wicket-internal coordinate representation is just passed to leaflet. When looking at the code, I think the idea was to override leaflet's "coordsToLatLng" method from wicket-leaflet.js, but this seems not to work (anymore?). |
No description provided.