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
Add gmf feature style directive #955
Conversation
ca484b9
to
ba46128
Compare
@fgravin Ready for review. |
0c744cb
to
f77b562
Compare
177bf2f
to
af296c2
Compare
af296c2
to
76adb1f
Compare
@adube Let's forget about the "icon" that was supposed to be displayed ahead of measure. I don't this is required. Can you please remove the bordered text in you example? |
if (newFeature) { | ||
keys.push( | ||
ol.events.listen( | ||
newFeature, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code could be a bit factored.
[gmf.FeatureProperties.ANGLE, gmf.FeatureProperties.COLOR, ...].forEach(function(propName) {
keys.push(
ol.events.listen(
newFeature,
ol.Object.getChangeEventType(propName),
this.handleFeatureChange_,
this
)
);
}.bind(this)
Looks good in the approach. Have you watched the |
|
76adb1f
to
ed34061
Compare
cc8fe6f
to
2cde160
Compare
@fgravin I made all the requested/discussed modifications, with the exception of the modifications to the Please merge if everything looks okay (once Travis passes). |
(You may need to clean your browser cache to see the changes in the live example). |
/** | ||
* @enum {string} | ||
*/ | ||
ngeo.FeatureProperties = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn' start with upper case, it's not a class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix this. Sorry, I'm used to OL3 doing it this way, see: https://github.com/openlayers/ol3/blob/master/src/ol/layer/layerbase.js#L12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well maybe i'm wrong ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep it like this then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For enums upper-case is fine. 👍
Thanks for the review. |
This PR introduces a
gmf-featurestyle
directive and an example featuring it. It also introduces agmf.FeatureHelper
service that is responsible of giving utility methods to create, get and set the style for a feature using its inner properties. It also contains methods to calculate and return a measure string from a feature geometry.Wiki: https://github.com/camptocamp/c2cgeoportal/wiki/Spec-%231658-Measures-and-redlining
Tasks remaining to do
ol.geom.Circle
as type of geometry, then we need to adjust what has been made. Answer: we'll keep circles as polygons, as before.Live example