-
Notifications
You must be signed in to change notification settings - Fork 75
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
Annotation geojson #617
Annotation geojson #617
Conversation
The order is not guaranteed to be the same as the exported order; points will end up before rectangles and polygons due to grouping by the geojson reader.
2e113e5
to
476f0fd
Compare
You can edit the geojson live.
476f0fd
to
b876b37
Compare
Current coverage is 85.39% (diff: 100%)@@ master #617 diff @@
==========================================
Files 85 85
Lines 8019 8211 +192
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 6641 7012 +371
+ Misses 1378 1199 -179
Partials 0 0
|
@aashish24 This is ready for review. |
Cool! Will review it soon, thanks 👏 👏 |
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 code looks reasonable to me, I also tried to manipulate geojson many times and after some initial glitch (not able to reproduce), things worked great to me! Just has some very minor questions.
@@ -8,7 +8,7 @@ var exampleUtils = { | |||
'&').map(function (n) { | |||
n = n.split('='); | |||
if (n[0]) { | |||
this[decodeURIComponent(n[0])] = decodeURIComponent(n[1]); | |||
this[decodeURIComponent(n[0].replace(/\+/g, '%20'))] = decodeURIComponent(n[1].replace(/\+/g, '%20')); |
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.
why this was needed?
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.
decodeURIComponent
doesn't decode +
to a space in Chrome, but urls are allowed to use +
to encode spaces.
* annotations and leave unchanged annotations. | ||
* @param {string|geo.transform} [gcs] undefined to use the interface gcs, | ||
* null to use the map gcs, or any other transform. | ||
* @param {boolean} includeCrs: if true, include the coordinate system in the |
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.
should we rename includeCrs to includeGcs to be consistent?
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.
In geojson it is called crs
. Since this affects the geojson output, I figured it should be crs in this context, not gcs.
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.
okay thats fine, I just thought that everywhere else we used gcs but I don't have strong feeling about it.
Annotation layers can output and input geojson. Using its own geojson will reconstruct the annotations (though they may have different internal IDs). Modifying the geojson updates the annotations.
The annotation example has the ability to live-edit the geojson.
This requires PR #616.