Skip to content
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

Proper geometry exports #936

Merged
merged 2 commits into from
Aug 28, 2013
Merged

Proper geometry exports #936

merged 2 commits into from
Aug 28, 2013

Conversation

tschaub
Copy link
Member

@tschaub tschaub commented Aug 28, 2013

The export in 6baf5d0 just gave us the abstract method on the base type. What is really needed is exports of getCoordinates on each geometry type.

I'm also adding in an example tweak here (because it's getting painful to wait for Travis on small example changes).

@ahocevar
Copy link
Member

I don't think you need to export the getCoordinates() method for each subclass. I'd try something like this:

@exportSymbol ol.geom.Geometry
@exportProperty ol.geom.Geometry.prototype.getCoordinates

@exportSymbol ol.geom.Point
@exportSymbol ol.geom.LineString
@exportSymbol ol.geom.Polygon
@exportSymbol ol.geom.MultiPoint
@exportSymbol ol.geom.MultiLineString
@exportSymbol ol.geom.MultiPolygon

But either way, please merge.

@tschaub
Copy link
Member Author

tschaub commented Aug 28, 2013

I don't think you need to export the getCoordinates() method for each subclass.

That was the situation back in 6baf5d0. Which didn't work. After compilation, getCoordinates was a property of ol.geom.Geometry.prototype but was undefined. Which makes sense if goog.abstractMethod is undefined. Since a specific getCoordinates method is provided by each of the geometry types, it also makes sense that each needs to be exported individually (we aren't accessing the method on the base geometry prototype).

@elemoine
Copy link
Member

Overriding creates new functions, meaning that specific exports/aliases are required. If a subclass doesn't override a method an export to the parent's method suffices.

@elemoine
Copy link
Member

Looks good to me.

tschaub added a commit that referenced this pull request Aug 28, 2013
@tschaub tschaub merged commit 7cac818 into openlayers:master Aug 28, 2013
@tschaub tschaub deleted the geom-exports branch August 28, 2013 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants