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

Fix #1314 Support to print vector layer #1317

Merged
merged 6 commits into from
Dec 6, 2016

Conversation

offtherailz
Copy link
Member

  • Support vector style for leaflet layers
  • Conversion to OL2 style format
  • add reprojectGeoJson utility method to CoordinateUtils
  • Print preview support
  • Markers
  • ForceUpdate when layer's created (needed to display features on vector layer mount).
  • Optimized leaflet layer rendering
    This fixes PDF support for vector layers (OpenLayers) #1315 too, because I created a style abstraction that can be used in every map.

 - Support vector style for leaflet layers
 - Conversion to OL2 style format
 - add reprojectGeoJson utility method to CoordinateUtils

Missing:
 - Print preview support
 - Markers
 - Now you can print also markers
 - Now the preview shows the vector layer

**note**: a little bug have to be solved. The preview map do not
show features on first rendering. This can be avoided loading them
in the VectorLayer on startup, but this will cause duplicated
vectors data.
@offtherailz offtherailz changed the title Fix #1314 Support to print vector layer (leaflet) Fix #1314 Support to print vector layer Dec 2, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 79.466% when pulling 346275d on offtherailz:i_1314 into 1e69050 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 79.531% when pulling fd2b466 on offtherailz:i_1314 into 1e69050 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 80.194% when pulling 15cb53c on offtherailz:i_1314 into 1e69050 on geosolutions-it:master.

shouldComponentUpdate(newProps) {
// the reduce returns true when a prop is changed
// optimizing when options are equal ignorning loading key
return !(["map", "type", "srs", "position", "zoomOffset", "onInvalid", "onClick", "options"].reduce( (prev, p) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a use case where the layer was slow without this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed an increase of performances during debug, with many features in the map.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I did not tested if it is perceptible in the normal application, but when you have both map and print preview (doubling in fact the number of features) it can become slow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I go on with merge?

@mbarto mbarto merged commit d33e1f8 into geosolutions-it:master Dec 6, 2016
offtherailz added a commit to offtherailz/MapStore2 that referenced this pull request Dec 6, 2016
…it#1317)

* Fix geosolutions-it#1314 Support to print vector layer (leaflet)

 - Support vector style for leaflet layers
 - Conversion to OL2 style format
 - add reprojectGeoJson utility method to CoordinateUtils

Missing:
 - Print preview support
 - Markers

* Add default marker and preview for vector print

 - Now you can print also markers
 - Now the preview shows the vector layer

**note**: a little bug have to be solved. The preview map do not
show features on first rendering. This can be avoided loading them
in the VectorLayer on startup, but this will cause duplicated
vectors data.

* fixed preview issues for same named layer

* ForceUpdate when layer's created. Optimized leaflet layer rendering

* rounded reprojection coordinates tests

* add tests for feature and vector layers
@offtherailz offtherailz deleted the i_1314 branch January 26, 2018 10:01
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.

PDF support for vector layers (OpenLayers)
3 participants