Skip to content

Commit

Permalink
- Add check to display cesium geojson point as point instead of billb…
Browse files Browse the repository at this point in the history
…oard. (#684)
  • Loading branch information
htran84 authored Apr 15, 2021
1 parent 6b67530 commit ad4d82b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tethys_gizmos/static/tethys_gizmos/js/cesium_map_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ var CESIUM_MAP_VIEW = (function() {
else if (curr_entity_options.source.toLowerCase() == 'geojson')
{
var gjson = curr_entity_options.options;
var default_point = gjson && gjson['properties'] && gjson['properties']['default_point'] == 'point'
var dataSourcePromise = Cesium.GeoJsonDataSource.load(gjson).then(function(source_result) {
source_result['tethys_data'] = curr_entity_options.data;
source_result['legend_title'] = curr_entity_options.legend_title;
Expand All @@ -354,7 +355,18 @@ var CESIUM_MAP_VIEW = (function() {
if ('layer_options' in curr_entity_options && curr_entity_options.layer_options &&
'visible' in curr_entity_options.layer_options) {
source_result.show = curr_entity_options.layer_options.visible;
if (default_point) {
var point = new Cesium.PointGraphics({
color: Cesium.Color.ORANGE,
pixelSize: 8,
});
source_result.entities.values.forEach((value) => {
value.billboard = undefined;
value.point = point;
})
}
}

return source_result;
});
m_viewer.dataSources.add(dataSourcePromise);
Expand Down

0 comments on commit ad4d82b

Please sign in to comment.