Cesium OSM Buildings | TerriaMap-next

254 views
Skip to first unread message

Aditya Patil

unread,
Oct 31, 2020, 8:14:25 AM10/31/20
to TerriaJS

I am trying to load osm 3d Buildings using the following catalog item :

{ "name": "Cesium OSM Buildings", "type": "3d-tiles", "isEnabled":"true", "isMappable":"true", "isShown":"true", "cacheDuration":"1d", "ionAssetId": 96188, "style": { "color": "Boolean(${feature['cesium#color']}) ? color(${feature['cesium#color']}) : rgb(255,255,255)" }, "colorBlendMode": "HIGHLIGHT" }

But unfortunately when i open TerriaJsMap-next at localhost:3001 using gulp watch
i cannot load the osm buildings layer
and it says that -> "This dataset may currently be experiencing issues"cesium-osm-bug.PNG


same is true for "cesium-terrain" layer, but i know for a fact that the layers are functional on TerriaJSMap on the previous version. What might be the issue ?


Kevin Ring

unread,
Nov 1, 2020, 1:05:16 AM11/1/20
to TerriaJS
If you're not specifying a Cesium ion access token anywhere, then you're using the default open source one shipped with CesiumJS, and that expires after two months. Depending on when TerriaJS last merged in a new CesiumJS version, the built-in key may be invalid.

So, you need to go to cesium.com, create an ion account, get an access token and put it in the "cesiumIonAccessToken" property in config.json. See https://docs.terria.io/guide/customizing/client-side-config/

Kevin

--
You received this message because you are subscribed to the Google Groups "TerriaJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terriajs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terriajs/dc674147-cf7a-4095-ba8f-c27aa501d1dbn%40googlegroups.com.


--

Aditya Patil

unread,
Nov 1, 2020, 3:24:19 AM11/1/20
to TerriaJS
Hello Kevin ! Thank you for your Reply but as i can see in the attached config.json file i have specified a property  "cesiumIonAccessToken" in the file yet the issue of the OSM building and terrain layers not loading up persists.Please guide me with the same.This is the same key that is functional in the older build of TerriaMap and works flawlessly.
 
< While building with gulp i get a error that Buffer() is Deprecated for which i replaced it with Buffer.from() in the gulpfile.js >

Best Regards.
config.json

Kevin Ring

unread,
Nov 1, 2020, 3:57:49 AM11/1/20
to TerriaJS
Ok that key looks fine and is authorized to access Cesium OSM Buildings, so the problem isn't what I thought it was. Are there any errors in the browser's console?





--
Message has been deleted

Aditya Patil

unread,
Nov 1, 2020, 5:33:34 AM11/1/20
to TerriaJS
Attached here is the browser console log file.

Best Regards.

console-export-2020-11-1_15-57-1.txt

Aditya Patil

unread,
Nov 2, 2020, 4:48:37 AM11/2/20
to terr...@googlegroups.com
Also after running Jasmine Spec runner in TerriaMap-next\wwwroot\build\TerriaJS\SpecRunner.html 
I get a console error log which is attached herewith.

What am i missing here,Is is a TerriaJS Issue or is there a problem with my Dev - environment? or is TerriaJS incorrectly setup on my side?
TerriaMap-next is referencing terriajs-8.0.0-alpha.59.
Awaiting your reply.

Best regards.

TerriaMap-next.log

Stephen Davies

unread,
Nov 2, 2020, 11:08:44 PM11/2/20
to TerriaJS
We've had some problems with terriajs 8.0.0-alpha.59. We've published a 8.0.0-alpha.60 with with some new changes and the troublesome commits from 59 reverted. That should fix some of React warnings you're getting. Many of the warnings in console are expected at this point and shouldn't affect your map. Let us know if alpha 60 fixes your problem.

Regards,
Stephen

Stephen Davies
Terria tech lead @ CSIRO's Data61

Aditya Patil

unread,
Nov 4, 2020, 6:37:01 AM11/4/20
to TerriaJS
@steve9164 Thank you so much for your prompt reply ! terriajs version 8.0.0-alpha.60 indeed fixes the issue and now we are able to load OSM Buildings in terriajs again ! .

Even so on a side note i had few queries and needed guidance about TerriaJS and TerriaMap-next itself,

1//How can you call external API's such as Cesium APIs from within terriajs, so as to modify layers displayed in terriajs for example such as the color of the OSM buildings layers ,"conditionally" based on certain programmatic constraints and parameters?
2//Similarly how can you make calls to ESRI API's or Amazon Machine Learning API's, what is the recommended way of doing so ?and If there is a documentation for the same ?

Best Regards.

Stephen Davies

unread,
Nov 24, 2020, 9:08:33 PM11/24/20
to TerriaJS
Hi,

Sorry for the slow reply. If the functionality of a certain CatalogItem (or CatalogGroup, etc.) doesn't allow for what you want to do you might need to create a modified version of that CatalogItem and "regsiter" it (call CatalogMemberFactory.register with your own unique "type" string and the new class). To make it easier for you to maintain this "clone" of the CatalogItem you can move functionality from the original CatalogItem into a Mixin and implement both the original CatalogItem and your new item with that Mixin. We are open to accepting PRs that do this, but you should discuss with our team before you put in significant effort for this to ensure there's a shared understanding.

To illustrate the above some time ago we needed a slightly custom Cesium3DTilesCatalogItem. So we moved the entire functionality to a Mixin (see PR https://github.com/TerriaJS/terriajs/pull/4535/files) and then used that to implement both Cesium3DTilesCatalogItem and our custom item (which unfortunately isn't open source). In the custom item we apply the Mixin and reimplement some functions (e.g. forceLoadMapItems). Inside each of those reimplemented functions we call super.functionName(params) and then modify the result before returning it.

For question 2 I'm not familiar with the APIs you're asking about, but for the APIs we call, we use loadJson (or the other loadXxx functions) in lib/Core of terriajs, which uses Cesium's Resource class. You probably will need to create a new CatalogItem/Group/Function to do something with the results of these APIs.

I hope I answered your questions. Please if you have any more post them to https://github.com/TerriaJS/terriajs/discussions/

Regards,

Stephen Davies
Reply all
Reply to author
Forward
0 new messages