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

KML Support #873

Open
42 of 76 tasks
andr3nun3s opened this issue Jun 17, 2013 · 85 comments
Open
42 of 76 tasks

KML Support #873

andr3nun3s opened this issue Jun 17, 2013 · 85 comments

Comments

@andr3nun3s
Copy link
Contributor

andr3nun3s commented Jun 17, 2013

This issue has been heavily edited since Andre's original write-up and is now maintained by @mramato.

The initial KML implementation was started as part of the 2013 Google Summer of Code and resulted in many core features being implemented by @Andre-Nunes in his branch. Current work is taking place in the kml branch of the official Cesium repository. Since KML is a large specification, the plan is to implement what we see as the minimum viable product first and officially release that as part of Cesium. We will then continue to add additional functionality on a feature by feature basis with each Cesium release.

The below task list tries to capture everything at a fairly high level for each phase. There are many hidden features and requirements here and listing them all isn't useful. For example, we are going to need polygon and polyline draping on terrain as a core Cesium feature (#2172). We will add new tasks when we encounter an issue as we implement each of the high-level types. If you have a strong need for a feature that we haven't gotten to yet, or feel we're missing something in the below list; please don't hesitate to let us know.

Related Links

Mailing-list topic
Google Documentation
OGC Specification

Random notes

  • We need to match handling of missing x/y/w/h values when using Placemark gx sub-region
  • All billboards KML produces are currently square, Google Earth instead scales the longer edge to 32 while maintaining aspect ratio. This can be seen in the KMZ Sandcastle demo, which has squate flags in Cesium and rectangular flags in GE.
  • Cesium doesn't have any way to support BalloonStyle:displayMode. I'm not sure we care.
  • We currently replace BalloonStyle text $[geDirections] with nothing. If we ever provide out of the box routing, we can use that instead.
    (https://github.com/gregjacobs/Autolinker.js) can be used to do this.
  • We may be able to use createObjectURL for loading data from a zip file (which is currently using data uris). The problem here is that you need to call revokeObjectURL in order to clean things up when you're done.
  • We need to support passing an ellipsoid to KmlDataSource to support other planets.
  • We may want to expose some way to customize default values, either by exposing default entity graphics directly, or exposing a limited set of options (like GeoJSONDataSource does)
  • Clicking on a link in a balloon description that returns KML has special behavior in GE. While we probably won't mirror that directly in Cesium, we should provide a mechanism to be able to do so (maybe through events).
  • zip.js has the ability to report progress which we currently don't utilize. loadXmlFromZip and loadDataUriFromZip in KmlDataSource.js would be the place to start if we ever want to add it. We just need to pass a onprogress callback as the third parameter to entry.getData
  • It would be nice to have a KML animation demo that uses TimeSpan, similar to the US states formation demo in Google's own documentation.
  • Google Earth silently ignores errors with invalid dates (such as having garbage in a when block). If we want to match Google Earth, we should too. Rather than try/catching JulianDate.fromIso8601, we should add a exceptionless version that returns undefined.
@mramato
Copy link
Contributor

mramato commented Jun 18, 2013

This is a good start. Let's concentrate on Placemark and geometry first. We can just render point geometry as default billbboards and everything else as white lines and polygons. This will help us get basic architecture in place and also show some early visual progress. We'll probably have to further break up some of these roadmap items into smaller tasks as we go.

@andr3nun3s
Copy link
Contributor Author

I believe that Point and LineString is done.

I've also marked style processing and styleUrl.

@andr3nun3s
Copy link
Contributor Author

Hey @mramato, how's this going? Is there anything I can do to help out?

@mramato
Copy link
Contributor

mramato commented Feb 20, 2014

Hey @Andre-Nunes. I haven't worked directly on KML in a little while but #1444 adds some major features that we needed in order to move forward (such as extruded polygons), so once that's in master and I merge it down, there should be some exciting stuff.

One thing you could start looking into is supporting the various Balloon options and styles. There's some basic code in their now that hooked up the description property to load balloon data in our new InfoBox widget, sync up and give it a try. We would want to also handle BallonStyle and ExtendedData. I have at least one KMZ I can send you that uses these, let me know and I'll email you.

Other than that, feel free to just review what's there (and the list above) and see if there's anything you want to do. No matter how small, feel free to open a pull request into this branch any time.

@andr3nun3s
Copy link
Contributor Author

Yes, please send me the KMZ and I'll start looking into Ballon options and styles during the week!

@mramato
Copy link
Contributor

mramato commented Sep 30, 2014

I did another pass on the main task list and unchecked most of the boxes for now. My plan is to go through what we have and validate/complete each item and then I'll start checking things back on one at a time.

@andr3nun3s
Copy link
Contributor Author

Hey, I'd like to help out if possible, I was really busy last time and would like to make up for it. Just let me get up to speed on current developments.

Is there anything specific I could look into?

@mramato
Copy link
Contributor

mramato commented Sep 30, 2014

That would be awesome. I'm in the process of figuring out where we left off (since I haven't looked at this code in months) but once I have a plan of attack put together I'll let you know and we can split up the work. I'll also probably create a new mailing list post to let people know what we're up to and where we are going. Are you still in school, or have you graduated?

@andr3nun3s
Copy link
Contributor Author

That sounds good!

I'm still in school but as I'm just attending some leftover courses I'll have more free time during this year.

Let me know when you've got the plan worked out.

This was referenced Oct 3, 2014
@pjcozzi pjcozzi assigned mramato and unassigned mramato Oct 6, 2014
@mramato mramato mentioned this issue Feb 20, 2015
6 tasks
@mramato
Copy link
Contributor

mramato commented Feb 20, 2015

Hey @Andre-Nunes I know we haven't talked much but I just wanted to let you know that we just opened a PR for KML to go into master (link above this post). There's still a lot of work to do with KML overall, but it's looking really good for a bunch of use cases. That's again for getting the ball started on this!

@andr3nun3s
Copy link
Contributor Author

Hi @mramato, I'm really glad to see some of my work being finally merged into cesium, let me know if there's something I can help out with in my free time. Oh and I just noticed that you've updated GSoC's ideas for 2015, is Cesium applying this year? I might shoot you an email regarding that ;)

@mramato
Copy link
Contributor

mramato commented Feb 20, 2015

Yes, we're applying. I assumed you graduated already. Definitely let me know if you're interested and what you want to work on.

@GatorScott
Copy link

Some, because I didn't try them all, of the KML files available from http://activefiremaps.fs.fed.us/googleearth.php result in error.

An error occurred while loading the file: conus_latest_modis.kml
An error occurred while loading the file, which may indicate that it is invalid. A detailed error report is below:

Request has failed.

@GatorScott
Copy link

The file https://www.google.com/maps/d/kml?mid=zp8nK_5H0MFQ.kzTmU5XK-qJQ results in the following:

An error occurred while loading the file: 2015 California Fire Map.kmz
An error occurred while loading the file, which may indicate that it is invalid. A detailed error report is below:

TypeError: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at Autolinker.HtmlParser.Autolinker.Util.extend.parse (http://localhost:8080/Source/ThirdParty/Autolinker.js:947:24)
at Autolinker.link (http://localhost:8080/Source/ThirdParty/Autolinker.js:359:15)
at processDescription (http://localhost:8080/Source/DataSources/KmlDataSource.js:1225:27)
at processFeature (http://localhost:8080/Source/DataSources/KmlDataSource.js:1288:9)
at processPlacemark (http://localhost:8080/Source/DataSources/KmlDataSource.js:1331:17)
at processDocument (http://localhost:8080/Source/DataSources/KmlDataSource.js:1319:21)
at processFolder (http://localhost:8080/Source/DataSources/KmlDataSource.js:1327:9)
at processDocument (http://localhost:8080/Source/DataSources/KmlDataSource.js:1319:21)
at processFeatureNode (http://localhost:8080/Source/DataSources/KmlDataSource.js:1477:13)
at http://localhost:8080/Source/DataSources/KmlDataSource.js:1502:13

@mramato
Copy link
Contributor

mramato commented Mar 3, 2015

Thanks @GatorScott. The Request has failed. is a CORS issue. Just like imagery, any KML files loaded via url to another website or that contain a NetworkLink to another website either needs CORS to be enabled on that server or it has to go through a proxy. I'm writing up a tutorial on using KML in Cesium and I plan on having a section covering this.

That being said, once I used a proxy, I got a lot of errors about invalid styles; so I'll definitely look into and fix the issue for all KML on that page.

The length issue appears to be a clear cut bug caused by KML objects with no description but an empty ExtendedData node. It's an easy fix that I'll have a PR open for in a few minutes.

Thanks again for the link.

@mramato
Copy link
Contributor

mramato commented Mar 3, 2015

#2538 fixes the length problem.

mramato added a commit that referenced this issue Mar 3, 2015
In #873, @GatorScott found a bunch of KML files that either didn't work
or didn't match Google Earth.  Turns out that Google Earth handles
local styles that do not start with a `#` sign, which is not spec compliant.
Since our goal is to match Google Earth, we now process these styles
properly rather than spitting out a warning/error.

We were also missing support for the TimeStamp element, which was an
oversight on my part.

The above changes make all KML files on http://activefiremaps.fs.fed.us/googleearth.php
work properly (though they require a proxy).
@mramato
Copy link
Contributor

mramato commented Mar 3, 2015

#2539 fixes the rest of the issues. All of the files @GatorScott linked to should now load and work in Cesium (though loading directly from the URL, or ones that use NetworkLink still require use of a proxy).

@GatorScott
Copy link

The "2015 California Fire Map KML" works now but is displaying the placemark names using a serif font that is pretty illegible.

@ggetz
Copy link
Contributor

ggetz commented Jun 18, 2018

onRegion networkLink event support requested on the forum: https://groups.google.com/forum/#!topic/cesium-dev/MOuIjyW4pew

@bbehling-trimble
Copy link

Has terrain support been added? When I add a KML and a terrain provider, the KML moves around when I pan the globe. When I turn off terrain, its fine. Also tried setting clampToGroup: true and still an issue.

@hpinkos
Copy link
Contributor

hpinkos commented Oct 17, 2018

@bbehling-trimble yes, some terrain support has been added. In addition to passing in the clampToGround: true flag to the KmlDataSource, you need to make sure your KML has the correct altitude mode set for placemarks. ie <altitudeMode>clampToGround</altitudeMode>. Note that altitude modes like clampToSeaFloor are not supported, and relativeToGround has support for some placemark types but not all. If the altitude mode is not supported there should be a warning logged to the console.

@bbehling-trimble
Copy link

bbehling-trimble commented Oct 17, 2018

@hpinkos That did not work. Do we need to specify the altitude as well?

EDIT: I tried adding altitude tags, no change.

Dimensions2018OffsiteScans2.kml.zip

@mramato
Copy link
Contributor

mramato commented Oct 17, 2018

Thanks for the example file. At first glance, this looks like a bug. I'll take a closer look and let you know.

@mramato
Copy link
Contributor

mramato commented Oct 22, 2018

@bbehling-trimble KML requires <tessellate>1</tessellate> be set on line strings in order for them to conform to terrain. None of the strings in the file you posted have this set. I updated the file and now it loads as expected in Cesium.

Dimensions2018OffsiteScans2.zip

That being said, I'm not sure why the original file was loading on terrain in Google Earth. Longer lines I tested in Google Earth do not follow the terrain unless tessellate is set. This is probably another case of Google not following their own format and having undocumented behavior (happens all of the time).

I'll look more into it and possibly open a PR to better match GE (if I can figure out the "rules") but for now the most correct thing to do is add tessellate to the LineString.

@bbehling-trimble
Copy link

@mramato Thanks!

@thw0rted
Copy link
Contributor

This thread has been quiet again for a while! I'd like to make another quick suggestion -- again, it can be its own issue if need be, but it's very small. I'm using the KmlDataSource in a context where it would be helpful to know if the loaded file has NetworkLinks or not. I'd like to show the user whether or not they can expect the data to periodically update itself. I don't need tons of details, but even something like a hasNetworkLinks boolean (implemented as get() { return this._networkLinks.length > 0; }) would be useful as part of the public API so I don't have to dig around under the hood.

@OmarShehata
Copy link
Contributor

I just got a request for supporting SchemaData over the support email. Is this something that would be easy to support?

@gogo1211
Copy link

Hello, @mramato
#873 (comment)
Please let me know how to handle that CORS issue while loading KML. #8381

@OmarShehata
Copy link
Contributor

@gogo1211 Hannah's response here #8381 (comment) explains it best. You need to configure this on your server host. If you need additional help please open a thread on the Cesium forum.

@gogo1211
Copy link

@OmarShehata , thank you!

@paullenhardt
Copy link

paullenhardt commented Nov 26, 2019

I have come across an odd issue relating to kml 'Folder' support (which is currently marked as supported). If I load a kml file with folders, none of the data shows within cesium and I get no errors on the console.

var viewer = new Cesium.Viewer('cesiumContainer');
var options = {
   camera: viewer.scene.camera,
   canvas: viewer.scene.canvas
};
viewer.dataSources.add(Cesium.KmlDataSource.load('test_wind.kml', options)).then(function(data){ 
   console.log("Data loaded:", data);
});

The above outputs "Data loaded" and displays nothing within cesium.

As soon as I strip the folder tags out of kml, everything seems to work.

var viewer = new Cesium.Viewer('cesiumContainer');
var options = {
   camera: viewer.scene.camera,
   canvas: viewer.scene.canvas
};
viewer.dataSources.add(Cesium.KmlDataSource.load('test_wind_no_folders.kml', options)).then(function(data){ 
   console.log("Data loaded:", data);
});

test_wind.kml

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
  <Style id="deg180speed50">
    <IconStyle>
      <scale>1.125</scale>
      <heading>180</heading>
      <Icon>
        <href>track-0.png</href>
      </Icon>
    </IconStyle>
  </Style>
  <Folder id="time1499886000.0">
    <name>1499886000.0</name>
    <visibility>0</visibility>
    <Folder id="altitude24000">
      <name>24000</name>
      <visibility>0</visibility>
      <Placemark>
         <styleUrl>#deg180speed50</styleUrl>
         <Point>
            <altitudeMode>clampToGround</altitudeMode>
            <coordinates>-98,38</coordinates>
         </Point>
      </Placemark>
    </Folder>
  </Folder>
</Document>
</kml>

test_wind_no_folders.kml

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
   <Document>
      <Style id="deg180speed50">
         <IconStyle>
            <scale>1.125</scale>
            <heading>180</heading>
            <Icon>
               <href>track-0.png</href>
            </Icon>
         </IconStyle>
      </Style>
      <Placemark>
         <styleUrl>#deg180speed50</styleUrl>
         <Point>
            <altitudeMode>clampToGround</altitudeMode>
            <coordinates>-98,38</coordinates>
         </Point>
      </Placemark>
   </Document>
</kml>

--- Edit ---
I missed providing track-0.png
track-0
--- End Edit ---

@thw0rted
Copy link
Contributor

thw0rted commented Nov 27, 2019

I haven't tried loading your sample KML but you have both of your (nested?) folders' <visibility> tags set to 0, i.e. hidden. I spent 10 seconds searching the source for KMLDataSource and it looks like that tag should be respected so setting it to 1 is likely to fix your issue. If my guess is wrong and that's not the problem, you should probably file a top level issue to have somebody on the team investigate the bug.

@paullenhardt
Copy link

Well that would make plenty of sense. Apparently you can stare at an issue for hours and still never see the obvious.

GoogleEarth seems to ignore the <visibility> tag (I originally had set the <visibility> to '0' within my kml generator to try to suppress the display upon KML loading and forgot about removing the <visibility> tag when it had no effect on GoogleEarth) so I am glad to see that Cesium honors that tag.

The nested folders was simply because I pulled the example from a much larger data-set where there was more data which the nesting provided organization to.

Thanks for the assist in debugging despite the obvious blunder on my part.

@ainthek
Copy link

ainthek commented Mar 27, 2020

gxlTrack when rendered on terrain shows only icon, and path is underground.
Minimal KMLs are attached in sandcastle demos.

Let's have 4 points and 2 flavors of KML, one as LineString and one as gx:Track

First example: LineString works (after some suggestions on forum) https://sandcastle.cesium.com/index.html#c=bVRtT9swEP4rVr80lTKn6XipSgjTQOzDQCC12j4skzDOtbVw7Mh2Wgriv++cN1pYVTW95557vwvXyjqyEbAFQ86Jgi25BCuqgv6qsWDIa/FSK8eEAjMMyWumCHFgDAL3Rm9EDmbWmXEDzMFvbWS+aCjBKMzU2+gsUxtmiC6dwJgY65V4P4RwVoBhZNZmQS0HBbRBw56DxvYzx6NhS5GsKBf6h9GVymfEmQow7Blpwr5oXSyYWYHrkKdCYhIPycUz/tmAsZjWeTaI6TgbEFBc50KtEKjc8ss0G1ykmUq8DdKVRXztXDmLou12S3UJaiUsVeAipEQTOkEfNXG2ej7krrReSUxdFzUVnl1DT30Vyb1kHApmntKmqERhG9LbHbnB3idRLbWaHCw3ou5mulgLS/Dr1kCk5syDRC9JscPfpeBAk2if37rwTufOYJ0tgpgDa0FKnGEaJ9Ge1DOYdMJVOdzqHNKDrifRga634Fob7CZ6sWl8SuPJeHI8DY+mdBKPj04npMHGxw0Un8YnLRR/Peow1DefuNVNev7J9DiJ9mP0gaMPFSbRfoMTPwF8PrSrWTJj+yu4uru9r+Wg29zS6EJYQH276j8LecUcm+vKYIelZnnQuKD14xr5TewA4+AmD5yfNq5FNhiF3SGM/D62DrdrUEEbJiTLSnFPCfI+yKg/mvYO3lWWsjzfp561zPfNx8zf9RQUjkqg3YbJCuyf8V9v8VbbZWrOVM6Zdbiq6HehtXxk5nvlHOYzvJY74jTpezncS/ZTiku5W+iuqtFZFFHny0Tiefp/Tp3CW0iGrgk7RGAQDhLrdrLbqm+iKLVxpDIyoBT3tCj9ltroseJP4Ci31s8tiTqjJBcbInI8xg8vNLxUXGLrT3pZSTkXL4DXiPciNgdmfr44yzt8VUi285R1nN40IKV4YCh+tmpL2PP4Dw

Second Example:
gx:Track, "banner" is OK
but "track line" is UNDERGROUND
https://sandcastle.cesium.com/index.html#c=jVX7b9s2EP5Xbv7FNuBQjzzhKOq2Fu2GNU1QCxuwaUAZ6WwToUiDpOy4Rf73HfWKs3RYBMIy777v7vj4ToVW1sFW4A4NXIHCHbxFK+qK/d7YJuOimb7VynGh0Ixn8C1XAEEA2S+/LsCP69ubz9lPnzL4AbiUYBErCwa5RFeC0+DQGCLDHYqVAk3s5vFhOtet0VtRopn32QuiO/xDG1lmLWQyneXqcXqZqy03oDdOUOlU8rcmDkDBKzQc5t1imC1QIWutswFDZPsS462zDiJ5tcn0B6NrVc7BmRop7SW0ab9qXWXcrND1lvtKUhFfkjcP9GeLxlJZV/koYmE+AlSFLoVakaF2y6OLfPQmzVXiOQRXluxr5zbzINjtdkxvUK2EZQpdQJAgZjHFaIDz1cNz7ErrlaTSddVA8cG18NSvIrmVvMCKm/u0XVSiaBvS6z18pCNMgmbWeUq0hRHNbqbZWlig4dYIUhfcG0EvodrT71IUyJLgEN+FWD3MM8OLPhlZHFqLUtIJplESHMwGBJdOuLrEa11i+mzPk+CZb2Ds1qjSOIzOjsLjo+Mwi47n0SmNP5Ogcf0f8PyVwDh8DTAOvweknSi0NmUanbMoDuPTCzi5YHEUnpzHSTB4/wsfnrbw6Dw6ewU8Oj7p8cRtn+gVvHjIc3Zx+gLfGJ7OMwkOL1Pibxu9v3Qy3HBjh8bx7ub6tplPepVujK6ERfJ3sv6tku+44wtdG7pNUvNy0oZgzes94RfOkGImlIdUO3L+ZpME8tF01ot+6rXXBfT7P+nSzGBZq8JDJuWQZDo0iE7zTy7LeFkeQi875JPKqfInP0NFF1MQb8tljfav8G/PeGx4uVpwVRbcOpIlxc20lnfc/Fw7R/WM38u974TDXo4Pin1R4lLuM92vasqcXyOhrtLvA5r8jzMYuzbnmAyj2Sixbi97Af0oqo02DmojJ4yRJKuNF6QN7uriHh0rrPWHlgQ9KSnFFkRJXedfHwBqSaRX63vXspZyIb4itR1qDGL7jOYPlw7yhnqi5HsPWUfpx9bIGHUSmr5kdUs4iPgP

Third Example:
When no terraiin is specified, also gx:Track works
https://sandcastle.cesium.com/index.html#c=jZX7b9s2EMf/lZt/sQ041CNPOIq6rUW7YU0T1MIGbBpQRjrbRCjSICk7bpH/fUe94iwdFkOwzOPnHnx8z4VW1sFW4A4NXIHCHbxFK+qK/d7YJuOiGb7VynGh0Ixn8C1XAEEA2S+/LsA/17c3n7OfPmXwA3ApwSJWFgxyia4Ep8GhMeQMdyhWCjR5N582TDd5a/RWlGjmff6CAjj8QxtZZi0ymc5y9Ti9zNWWG9AbJ6h4KvpbEwmg4BUaDvNuOcwWqJC11tnAkLN9yXjrrEMkrzaZ/mB0rco5OFMjpb2ENu1XrauMmxW63nJfSSriS/LmgX5s0Vgq6yofRSzMR4Cq0KVQKzLUbnl0kY/epLlKvA/hypJ97dxmHgS73Y7pDaqVsEyhCwgJYhZTjAacrx6esyutV5JK11WD4oNr8dSvIrmVvMCKm/u0XVSiaBvS6z18pENMgmbUzZRoCyOa3UyztbBAj1sjSF1wbwS9hGpP30tRIEuCQ74LsXqYZ4YXfTKyOLQWpaQTTKMkOBgNBJdOuLrEa11i+mzPk+DZ3OCxW6NK4zA6OwqPj47DLDqeR6f0/JkEzdT/geevBOPwNWAcfg+knSi0NmUanbMoDuPTCzi5YHEUnpzHSTDM/hcfnrZ4dB6dvQKPjk96nnzbT/QKv3jIc3Zx+oJvDE/nmQSHlynxt43eXzoZbrixQ+t4d3N924wnvUo3RlfCIs13sv6tku+44wtdG7pNUvNy0oZgzes98QtnSDETykOqHTl/s0kC+Wg660U/9drrAvr9n3RpZrCsVeGRSTkkmQ4NotP805RlvCwP0cuOfFI5Vf40z1DRxRTkt+WyRvtX+Lf3eGz8crXgqiy4dSRLiptpLe+4+bl2juoZv5d73wuHvRwfFPuixKXcZ7pf1ZQ5v0airtLvA03+xxmMXZtzTIbRbJRYt5e9gH4U1UYbB7WRE8ZIktXGC9IGd3Vxj44V1vpDS4LeKSnFFkRJXedffwHUkkiv1veuZS3lQnxFajvUGMT2mZs/XDrIG+qJku89so7Sj62RMeokNHzp1S3hIOI/

How to fix/workaround samples to make gx:Track and their respecitive lines to work with terrainProvider ON ?

Are there any tests simulating behavior of KML imported data on terrain ? I have studied briefly DataSources/KmlDataSource test case, but is does not seem to cover terrainSpecific rendering which seems to be a problem.

Thanx a lot

@thw0rted
Copy link
Contributor

I'm not an expert but it looks like gx:track translates to PathGraphics under the hood. Polylines support clampToGround but Path does not have that option. If you think about it, this makes sense, because a Polyline has its own set of positions independent of the parent Entity, but Path relies on the time-variant Entity#position. The docs for KMLDataSource#load say that it clamps "geometry features (Polygons, LineStrings and LinearRings)" but not the entities themselves.

I've run into similar problems before but I am not loading from KML, so I don't know if my solution would help you. I compute a Cartographic for each position, then pass that to sampleTerrainMostDetailed, then if that fails I call sampleTerrain with a fixed level -- I picked 11, can't remember why. Once my Cartographics have been "clamped" then I update the original entity with new position(s). It's an asynchronous process but at the end the Entity is where I want it to be.

With KML, you'd have to "fix" all the Entities created after load finishes. The problem is that once a SampledPositionProperty has been created, there is no public API for retrieving the positions, so you have to poke around in the private part of the class.

It might be worth putting in a new ticket, either to have the KML#load option for clampToGround also clamp Entity positions when they're created, or to expose the samples in a SampledPositionProperty via a getter so that you can fix the positions yourself after the fact.

@thw0rted
Copy link
Contributor

thw0rted commented Apr 1, 2022

Anyone watching this issue might be interested in #10260 which I just filed. Not a huge change, but could be useful to some.

@icarter09
Copy link

Couple of questions on this ticket...

  1. What's the status of "StyleMap"->"Highlight" ?
  2. If "Highlight" is still a WIP, I would like to help out. What do I need to know about or where should I begin to look for getting Stylemap Highlight implemented?

Thanks.

@ggetz
Copy link
Contributor

ggetz commented Jun 21, 2022

Hi @icarter09,

  1. I believe StyleMap -> Highlight is still yet to be implemented.
  2. It would be great if you could contribute this! I'll look into getting you some more information, but in the meantime this comment mentions the areas of the code to look.

@martimpassos
Copy link

hello, are there plans to support PhotoOverlays? I would like to visualize geolocated images against Google's 3D Tiles

@selimsezr
Copy link

image

Hello everyone, I am currently using cesium 1.121 and I loaded the kml file in the picture. It does not say gx:AltitudeMode on the polygon on the ahead, but it does on the polygons on the behind. The code section is below. I want to determine it with cesium settings instead of the value written in the kml. How can I follow?

const kmlDataSource = await CesiumJs.KmlDataSource.load(kmlText, {
            camera: CesiumViewer.scene.camera,
            canvas: CesiumViewer.scene.canvas,
            clampToGround: true,
          });
          CesiumViewer.dataSources.add(kmlDataSource);
          const entities = kmlDataSource.entities.values;
  
          entities.forEach((entity:any) => {
            // Poligonların zeminle hizalanması
           if (entity.polygon) {
             entity.polygon.heightReference = CesiumJs.HeightReference.NONE;
             entity.polygon.extrudedHeightReference = CesiumJs.HeightReference.NONE;
           }

@ggetz
Copy link
Contributor

ggetz commented Sep 27, 2024

are there plans to support PhotoOverlays? I would like to visualize geolocated images against Google's 3D Tiles

@martimpassos There hasn't been any activity on PhotoOverlays recently.

If you'd like to add more information about your use case, that may help us prioritize. If you are interesting in contributing, please let us know and we'd be happy to discuss implementation or review a PR. Thanks!

Hello everyone, I am currently using cesium 1.121 and I loaded the kml file in the picture. It does not say gx:AltitudeMode on the polygon on the ahead, but it does on the polygons on the behind. The code section is below. I want to determine it with cesium settings instead of the value written in the kml. How can I follow?

@selimsezr CesiumJS is a big project, so we use GitHub for feature requests and bug tracking exclusively. Could you please take this question to the Cesium Forum? On the forum, there are members of the community and developers from the team who can help. Thanks!

@selimsezr
Copy link

@ggetz While doing research, I found this topic as a similarity and added it, but I can also open it as a different topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests