Loading app/package.json +1 −1 Original line number Diff line number Diff line Loading @@ -66,10 +66,10 @@ "webpack-merge": "^4.2.2" }, "dependencies": { "jquery": "^3.4.1", "@material-ui/core": "^4.9.0", "@material-ui/icons": "^4.5.1", "@material-ui/lab": "^4.0.0-alpha.41", "jquery": "^3.4.1", "leaflet": "^1.6.0", "proj4": "^2.6.0", "proj4leaflet": "^1.0.2", Loading app/src/components/App.jsx +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ export default class App extends Component { } componentDidMount() { let map = new AstroMap("map-container", "MIMAS", {}); let map = new AstroMap("map-container", "mars", {}); let projectionControl = new Projection(); projectionControl.addTo(map); Loading app/src/js/LayerCollection.js +33 −3 Original line number Diff line number Diff line Loading @@ -67,8 +67,10 @@ export default L.LayerCollection = L.Class.extend({ this.defaultLayerIndex = layers["base"].length - 1; } } else { if (currentLayer["displayname"] != "Show Feature Names") { layers["overlays"].push(currentLayer); } } } else { layers["wfs"].push(currentLayer); } Loading Loading @@ -124,9 +126,12 @@ export default L.LayerCollection = L.Class.extend({ if (feature.properties && feature.properties.name) { layer.bindPopup(feature.properties.name); } }, pointToLayer: function(feature, latlng) { return new L.CircleMarker(latlng, { radius: 3, fillOpacity: 1 }); } }); this.overlays["Show Feature Names WFS"] = this.wfsLayer; this.overlays["Show Feature Names"] = this.wfsLayer; }, /** Loading Loading @@ -203,9 +208,34 @@ export default L.LayerCollection = L.Class.extend({ dataType: "json", timeout: 30000, success: function(data) { // this.featureLayer.clearLayers(); let sortedFeatures = thisContext.sortFeatures(data["features"]); data["features"] = sortedFeatures; thisContext.wfsLayer.clearLayers(); thisContext.wfsLayer.addData(data); } }); }, /** * @details Sorts the features by diameter so that smaller features are on * top of the larger features on the map. Features with smaller * diameters will be put at the end of the list. * * @param {List} data - List of features. * * @return {Integer} Returns -1 if f1 < f2, 1 if f2 > f1, and 0 if f1==f2. */ sortFeatures: function(data) { return data.sort(function(a, b) { var f1 = a["properties"]["diameter"]; var f2 = b["properties"]["diameter"]; if (f1 < f2) { return 1; } else if (f1 > f2) { return -1; } else { return 0; } }); } }); Loading
app/package.json +1 −1 Original line number Diff line number Diff line Loading @@ -66,10 +66,10 @@ "webpack-merge": "^4.2.2" }, "dependencies": { "jquery": "^3.4.1", "@material-ui/core": "^4.9.0", "@material-ui/icons": "^4.5.1", "@material-ui/lab": "^4.0.0-alpha.41", "jquery": "^3.4.1", "leaflet": "^1.6.0", "proj4": "^2.6.0", "proj4leaflet": "^1.0.2", Loading
app/src/components/App.jsx +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ export default class App extends Component { } componentDidMount() { let map = new AstroMap("map-container", "MIMAS", {}); let map = new AstroMap("map-container", "mars", {}); let projectionControl = new Projection(); projectionControl.addTo(map); Loading
app/src/js/LayerCollection.js +33 −3 Original line number Diff line number Diff line Loading @@ -67,8 +67,10 @@ export default L.LayerCollection = L.Class.extend({ this.defaultLayerIndex = layers["base"].length - 1; } } else { if (currentLayer["displayname"] != "Show Feature Names") { layers["overlays"].push(currentLayer); } } } else { layers["wfs"].push(currentLayer); } Loading Loading @@ -124,9 +126,12 @@ export default L.LayerCollection = L.Class.extend({ if (feature.properties && feature.properties.name) { layer.bindPopup(feature.properties.name); } }, pointToLayer: function(feature, latlng) { return new L.CircleMarker(latlng, { radius: 3, fillOpacity: 1 }); } }); this.overlays["Show Feature Names WFS"] = this.wfsLayer; this.overlays["Show Feature Names"] = this.wfsLayer; }, /** Loading Loading @@ -203,9 +208,34 @@ export default L.LayerCollection = L.Class.extend({ dataType: "json", timeout: 30000, success: function(data) { // this.featureLayer.clearLayers(); let sortedFeatures = thisContext.sortFeatures(data["features"]); data["features"] = sortedFeatures; thisContext.wfsLayer.clearLayers(); thisContext.wfsLayer.addData(data); } }); }, /** * @details Sorts the features by diameter so that smaller features are on * top of the larger features on the map. Features with smaller * diameters will be put at the end of the list. * * @param {List} data - List of features. * * @return {Integer} Returns -1 if f1 < f2, 1 if f2 > f1, and 0 if f1==f2. */ sortFeatures: function(data) { return data.sort(function(a, b) { var f1 = a["properties"]["diameter"]; var f2 = b["properties"]["diameter"]; if (f1 < f2) { return 1; } else if (f1 > f2) { return -1; } else { return 0; } }); } });