-
Notifications
You must be signed in to change notification settings - Fork 3.7k
GeoJSON support #890
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
GeoJSON support #890
Conversation
Have GeoJsonDataSource use private versions of them instead until I do them "for real".
Apps/CesiumViewer/CesiumViewer.js
Outdated
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.
Does this work even if suffix is longer than str?
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.
Yes. The value of the second argument can be positive or negative and if suffix is longer it's impossible for this function to equal anything other than -1. However, your question brings up a good point, I don't need str.length - suffix.length because simply -suffix.length will work exactly the same.
|
Since you're asking for bike shed color recommendations, allow me to recommend |
|
It's not bike shedding for things that actually matter. I'll try out CYAN. What about the opacity of the polygons? Does that look good to you (too opaque or too translucent?) |
|
The opacity looks good. I don't think the casual observer will find a difference between 25 and 25.5, if you want to trim two bytes 😉 |
|
Okay, those changes are in. Are we happy with just using a Point primitive for points? Should we use a fancy placemark-like billboard instead? |
Apps/CesiumViewer/CesiumViewer.js
Outdated
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.
indexOf doesn't take a negative argument. From the ES5 spec, start is min(max(pos, 0), len), which means that passing -suffix.length is equivalent to passing 0.
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.
MDN lied to me, which is where I was looking. But you are correct. I double-checked the official spec PDF just to be sure. I'll undo my previous changes.
|
The default point is fine, people can configure it. Taking a second look at the OSM globe, it's very cyan already. Let's switch to |
|
@emackey I made it yellow, and I agree it's the most clear. That being said, keep in mind that anyone using Cesium Viewer will get these default values. I think we need a set of good looking defaults for Cesium Viewer (and I don't know why these wouldn't match the general defaults). That's why I think a custom placemark and easy on the eyes coloring is important. Yellow is visible, but not very pretty. |
|
Yeah, the goal of a default color is just to be visible-by-default in as many different situations as possible. You can't really change your defaults based on which imagery layer is selected etc, but you can make educated guesses that the OSM layer might be popular with GeoJSON users. A custom placemark can be nice. The upside-down raindrop shape allows more of the target area to be seen. Would we use a raster image for this, or just code a shader? |
|
We would just base encode a png into the source, just like we do with the Bing logo. If we go with the standard placemark change, I would also change the bitmap origin so that the botton of the placemark is the actual position in the file. |
|
Sure, non-scalable raster images can be useful. You could also use a GLSL shader. |
|
Except we have no way to express such things in the On a related topic, I was also thinking we could incorporate the Cesium logo into the placemark somehow, like instead of a black hole in the center, have the logo. |
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.
Arguably these are RuntimeErrors, not DeveloperErrors, since they're caused by data loaded at runtime.
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.
That makes sense, I almost never use RuntimeError so it didn't even occur to me. I suppose you could argue that it's a DeveloperError when using load and a RuntimeError when using loadUrl, but then we are really splitting hairs. I'll change them to RuntimeError.
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.
It's not clear to me what you're trying to do here. This looks like a no-op to me:
- adapt
crsFunctionto make it a promise if it's not already one - when that promise resolves, make a new promise that is already resolved to the
crsFunctionvalue.
|
Okay, all review changes so far are in. Anything else? |
|
Good with me 👍 @shunter please merge when ready. |
Source/DynamicScene/DynamicObject.js
Outdated
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 check this.hasOwnProperty(property) here? Shouldn't you merge other[property] into this regardless?
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.
Probably. I simplified it to:
for ( var property in other) {
if (other.hasOwnProperty(property)) {
this[property] = defaultValue(this[property], other[property]);
}
}
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.
Probably worth being consistent between geoJson and geojson throughout.
1. GeoJSON is the format name. 2. geojson is the extension we use. 3. geoJson is the identifier casing.
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.
Worth factoring out this function to convert an array of coordinates to an array of positions?
|
Okay, I think we're close. Anything else? |
|
Looks good, merging. |
viewerDragDropMixinand the Cesium Viewersourcequery parameter.ConstantPropertywhich makes it easy to specify static values for DynamicScene objects.