TerriaJS / terriajs

A library for building rich, web-based geospatial data platforms.
https://terria.io
Apache License 2.0
1.17k stars 362 forks source link

Billboard with elevation (over terrain) and init layers without CORS #3560

Closed bonellia closed 5 years ago

bonellia commented 5 years ago

Greetings, I've been working with various libraries in order to have the following features at once: -3D terrain on the map -Adding custom layers (will be points/billboards in this case) -Having distance measurement tool -Initializing the map with given geojson data (basically features of points, around 25 to be precise)

After testing leaflet and cesium, I finally settled with TerriaJS because it seems to have all of these at once. I have two issues as stated briefly on title:

1) Upon searching docs and previous issues (see https://github.com/TerriaJS/terriajs/issues/702) I have realized that the feature where layers are placed on top of 3D terrain instead of "below" it was initially available in Cesium, but I am not sure if it was further added to TerriaJS. I'd like to have a confirmation (and some tips to use how) if possible. clampToGround is available in Cesium as far as I can tell from the last responses in there, but I'm not sure if I can have my point/billboards appear on top of 3D terrain. Note that we need this to determine line of sight status among two devices for a "real-world" application.

2) I'd like to initialize the map with a geojson (that has those points I need to see) but I couldn't manage to add them to catalog directly from web-app's directory. I feel like my answer is somewhere on the following link: https://docs.terria.io/guide/connecting-to-data/catalog-type-details/geojson/ However, as far as I can tell, it allows using an outer data source. I have uploaded my geojson data temporarily and can reach it on https://raw.githubusercontent.com/bonellia/temp-geo/master/kocaeli.geojson?token=AD4AJSLUM4K7SETSQEPK2BC5DYSSW)

I am aware these are not particularly about the development of the library or relevant bugs etc, but I figured I could have some remarks about these subjects here.

Lastly, I am also wondering if I could use custom image/html on my billboards. I could simply use unicode ⚡ (high voltage icon) with html option or whatever icon I'd like if possible. This part is optional at this point.

Thanks in advance, Taha.

bonellia commented 5 years ago

A quick update: By editing the test init json, (I have found examples with geojson data type) I managed to initialize the map with the data I have. However, points unfortunately drop below the 3D terrain. To be sure, I tested with area layers and they are placed on top of the terrain properly. So I think I have used proper parameters. Still, I'd like to know if there's something I can do with the billboard/markers appearing below the terrain. For reference, I am attaching my json file's content:

{
  "homeCamera": {
    "west": 29.01,
    "south": 40.46,
    "east": 31.16,
    "north": 41.33
},
  "catalog": [
    {
      "name": "Sedas Data",
      "type": "group",
      "items": [
        {
          "name": "GeoJSON files",
          "type": "group",
          "items": [
            {
              "name": "Kocaeli - Sedas",
              "type": "geojson",
              "url": "test/tr_iller.geojson",
              "isEnabled": true,
              "clampToGround": true
            }
          ]
        }
      ],
      "isOpen": true
    }
  ]
}
steve9164 commented 5 years ago

Hi @bonellia. It's possible that the "clampToGround" property requires specific WebGL extensions, I know a couple of other features do. Are the white outlines when you select a region here on terrain, or below? If they're below your browser/GPU probably doesn't support the extensions needed.

Also please direct further questions on using TerriaJS to either our Gitter chat or our Google group.

bonellia commented 5 years ago

I'm getting 502 error from the link you've provided. However, I've kinda solved it by creating areas instead of billboards so this workaround was well enough for us. Thanks for your assistance and I'm sorry for using github issues for it. I'll use Google groups next time, cheers.