Skip to content

Commit

Permalink
fail silently on dataset load error in 3d (ref #153)
Browse files Browse the repository at this point in the history
  • Loading branch information
atlefren committed Oct 30, 2015
1 parent b7b1217 commit 83c0421
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 10 deletions.
6 changes: 5 additions & 1 deletion common/js/CesiumMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,12 @@ KR.CesiumMap = function (div, cesiumOptions, bounds) {
var dataSource = Cesium.GeoJsonDataSource.load(data);
callback(dataSource);
});
}, function (err) {
callback();
});
}

function loadDataset2(dataset, bbox, api, extraProps, callback) {
function loadDataset2(dataset, bbox, api, extraProps) {
api.getBbox(dataset, bbox, function (res) {
_.each(res.features, function (feature) {
feature.properties = _.extend(feature.properties, extraProps);
Expand All @@ -284,6 +286,8 @@ KR.CesiumMap = function (div, cesiumOptions, bounds) {

addMarkers(markers);
});
}, function (err) {
console.warn('could not load dataset', dataset);
});
}

Expand Down
2 changes: 1 addition & 1 deletion common/js/SidebarContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var KR = this.KR || {};


function _showPosition() {
if (div && map.userPosition && feature) {
if (div && map && map.userPosition && feature) {

if (content) {
content.remove();
Expand Down
12 changes: 11 additions & 1 deletion demonstratorer/trondheim.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@

<title>KNReise - Trondheim</title>

<link href='../dist/style_external.css' rel='stylesheet' />

<link href='../bower_components/components-font-awesome/css/font-awesome.min.css' rel='stylesheet' />
<link href='../bower_components/leaflet/dist/leaflet.css' rel='stylesheet' />
<link href='../bower_components/bootstrap/dist/css/bootstrap.min.css' rel='stylesheet' />
<link href='../bower_components/leaflet-sidebar/src/L.Control.Sidebar.css' rel='stylesheet' />
<link href='../bower_components/leaflet.knreise-markers/dist/leaflet.knreise-markers.css' rel='stylesheet' />
<link href='../bower_components/leaflet.markercluster/dist/MarkerCluster.css' rel='stylesheet' />
<link href='../bower_components/leaflet.markercluster/dist/MarkerCluster.Default.css' rel='stylesheet' />
<link href='../bower_components/Leaflet.Photo/Leaflet.Photo.css' rel='stylesheet' />
<link href='../bower_components/video.js/dist/video-js/video-js.css' rel='stylesheet' />
<link href='../bower_components/cilogi-marker/dist/cilogi-marker.css' rel='stylesheet' />
<link href='../dist/style.css' rel='stylesheet' />

<meta name="apple-mobile-web-app-capable" content="yes">
Expand Down
2 changes: 1 addition & 1 deletion dist/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ var KR = this.KR || {};


function _showPosition() {
if (div && map.userPosition && feature) {
if (div && map && map.userPosition && feature) {

if (content) {
content.remove();
Expand Down
4 changes: 2 additions & 2 deletions dist/scripts.min.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions dist/scripts3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -1456,10 +1456,12 @@ KR.CesiumMap = function (div, cesiumOptions, bounds) {
var dataSource = Cesium.GeoJsonDataSource.load(data);
callback(dataSource);
});
}, function (err) {
callback();
});
}

function loadDataset2(dataset, bbox, api, extraProps, callback) {
function loadDataset2(dataset, bbox, api, extraProps) {
api.getBbox(dataset, bbox, function (res) {
_.each(res.features, function (feature) {
feature.properties = _.extend(feature.properties, extraProps);
Expand All @@ -1480,6 +1482,8 @@ KR.CesiumMap = function (div, cesiumOptions, bounds) {

addMarkers(markers);
});
}, function (err) {
console.warn('could not load dataset', dataset);
});
}

Expand Down Expand Up @@ -1635,7 +1639,7 @@ var KR = this.KR || {};


function _showPosition() {
if (div && map.userPosition && feature) {
if (div && map && map.userPosition && feature) {

if (content) {
content.remove();
Expand Down
4 changes: 2 additions & 2 deletions dist/scripts3d.min.js

Large diffs are not rendered by default.

0 comments on commit 83c0421

Please sign in to comment.