TDesjardins / gwt-ol

GWT wrapper for OpenLayers 3+ using JSInterop
Apache License 2.0
70 stars 33 forks source link

olx namespace #102

Closed gkresic closed 7 years ago

gkresic commented 7 years ago

I'm not even sure what is the purpose of this namespace in OpenLayers, but I'm wondering if gwt-ol3 should support it?

One use case is to support ol.render.Event which references olx.FrameState. I'm planning to use it for animations like shown in this example.

TDesjardins commented 7 years ago

@gkresic have a look at https://github.com/openlayers/openlayers/blob/81acbc0f254fe51136c649ace357350043217383/externs/readme.md OpenLayers uses the olx namespace to declare objects with object literals as externs. Trough that this saves them from renaming by the closure compiler. All these classes don't have an explicit constructor. From my point of view we could wrap this in the standard namespace 'ol' in the way like the option classes are wrapped. For example:

ol.FrameState:

package ol;

@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class FrameState {

or as interface if we don't want to create own instances but why not? 😄

gkresic commented 7 years ago

Agree. Meanwhile, I've implemented my feature using com.google.gwt.animation.client.AnimationScheduler so I didn't need olx.FrameState, but if I encounter some other olx.* class, I'll implement it in ol namespace as you suggested.