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
Vector layer conversion #33
Conversation
|
||
/** | ||
* Convert a 2D or 3D OpenLayers coordinate to Cesium. | ||
* @param {!ol.coordinate} coordinate Ol3 coordinate |
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.
ol.coordinate
-> ol.Coordinate
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.
We usually end @param
descriptions with a dot.
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.
"Convert a 2D or 3D OpenLayers coordinate to Cesium." -> "Convert a 2D or 3D EPSG:4326 OpenLayers coordinate to a Cesium Cartesian3."
* @param {!ol.geom.geometry} olGeometry Ol3 circle geometry | ||
* @param {!ol.projectionLike} projection | ||
* @param {!ol.style} olStyle | ||
* @return {Cesium.Geometry|Array.<Cesium.Geometry>} geometries |
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.
Functions are easier to use when they always return values of the same type. In that case it should probably be Array.<Cesium.Geometry>
.
* @api | ||
*/ | ||
olcs.core.GL_ALIASED_LINE_WIDTH_RANGE; | ||
//goog.exportProperty(); |
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.
You can remove this.
This is ton of work. Thanks. I still have some comments. But it's good to go to me when they are addressed. |
@ahocevar , examples including vectors.html can now be executed with compiled ol3cesium.js. This PR depends on the merge of two ol3 PRs: openlayers/openlayers#2703 and openlayers/openlayers#2696 . Please have a look to these PRs. It would be really great if everyone could test now and report issues so that we can discuss proper solutions and have time to address them. As a side note, KML/geojson drag&drop on the ol3 map is enabled but not working. |
Thanks for the work on this. I did a bit more testing, and I found 2 issues:
It would also be good if @klokan could give this a review. |
Hi Andreas, thank you for testing. It seems the lags comes from the text style of polygons, please comment I am also able to load the countries geojson but not the 110m version. |
Rebased on master following the merge of #42. This PR is blocked by the still unmerged ol3 PRs. They are quiet simple and necessary to get working:
I will have little time next week; we need to move on. |
goog.events.unlisten(image, 'load', listener, this); | ||
reallyCreateBillboard(); | ||
}; | ||
goog.events.listen(image, 'load', listener, this); |
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.
The function parameters are actually: goog.events.listen(src, type, listener, opt_capt, opt_handler)
-- you are passing this
as a boolean determining the capture phase. It would also be better to use goog.events.listenOnce
in this case instead of unlistening the event after the first occurrence.
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.
Thank you for spotting the error.
I was not using listenOnce because I wanted to ensure the image has been
loaded correctly. However, getting a 'load' event may perhaps be enough.
Please make sure that |
What happens if you pass to Cesium an icon that is not already loaded? |
The icon will stay invisible for ever. |
Rebased on master. Please merge. |
reallyCreateBillboard(); | ||
}; | ||
|
||
goog.events.listenOnce(image, 'load', listener, false, this); |
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.
The last two parameters are actually not needed here.
Minor comments, otherwise LGTM. |
Fixes invisible icon in Cesium when image in not in the browser cache.
It is inside the green square-like geometry. Note that: - 3D polygons or circles are not handled by Cesium; - enabling depth test is necessary to prevent seeing a primitive through terrain.
Thanks @petrsloup for the good review. |
Core converters to be used by the vector synchronizer. #4 / #11
It handles:
Dashes are not handled in general though some experimental code exists for lines.
It is now ready for merging though some issues remain:
See drawText in src/ol/render/vector.js.
Blending styles to a unique plain style would be an idea, see http://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending
Updated to reflect new state.
Old demo at http://dev.camptocamp.com/files/gberaudo/vectors/examples/vectors.html