Skip to content

Commit

Permalink
Curtain Support (#152)
Browse files Browse the repository at this point in the history
* Curtain part 2

* rgrams styles

* Touch ups

* Use litho 1.3.0
  • Loading branch information
tariqksoliman authored Feb 24, 2022
1 parent 9cfda39 commit 2ddfd64
Show file tree
Hide file tree
Showing 20 changed files with 177 additions and 367 deletions.
2 changes: 1 addition & 1 deletion config/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ function makeLayerBarAndModal(d, level) {
dataSel = "selected";
break;
case "query":
barColor = "#0fbd4d";
barColor = "#62bd0f";
querySel = "selected";
break;
case "vector":
Expand Down
41 changes: 15 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,13 @@
"jest-resolve": "24.9.0",
"jest-watch-typeahead": "0.4.2",
"jquery": "^3.5.1",
"lithosphere": "^1.2.1",
"lithosphere": "^1.3.0",
"mark.js": "^8.11.1",
"memorystore": "^1.6.2",
"mini-css-extract-plugin": "0.9.0",
"nipplejs": "^0.8.5",
"node-fetch": "^2.6.1",
"node-schedule": "^1.3.2",
"openseadragon": "^2.4.2",
"optimize-css-assets-webpack-plugin": "5.0.3",
"pg-promise": "^10.6.1",
"png-js": "^1.0.0",
Expand Down
18 changes: 15 additions & 3 deletions src/css/mmgis.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ body {

/*Color variables*/
:root {
--color-mmgis: #26a8ff;
--color-mmgis: #08aeea;
--color-a: #010102; /*#1f1f1f;*/
--color-a1: #1f1f1f;
--color-b: #555555;
--color-c: #009eff;
--color-c: #08aeea;
--color-d: #2a2a2a;
--color-e: #4f4f4f;
--color-f: #e1e1e1;
Expand Down Expand Up @@ -71,6 +71,18 @@ body {
--color-r5: #00b7c7;
--color-r6: #8be04e;
--color-r7: #ebdc78;

--color-p0: #bdbd0f;
--color-p1: #c0822f;
--color-p2: #ffeaaf;
--color-p3: #62bd0f;
--color-p4: #bd0f32;
--color-p5: #edd49e;
--color-p6: #e7bdcb;
--color-p7: #72d1cb;
--color-p8: #08aeea;
--color-p9: #770fbd;
--color-p10: #bd0f8e;
}

#nodeenv {
Expand Down Expand Up @@ -299,7 +311,7 @@ body {
width: 20px !important;
height: 20px !important;
color: #ffffff !important;
background: #26a8ff !important;
background: var(--color-mmgis) !important;
}
.leaflet-popup-content {
margin: 1px 7px 1px 7px;
Expand Down
3 changes: 3 additions & 0 deletions src/css/mmgisUI.css
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,9 @@ blink {
.slider2.darker {
background: var(--color-a);
}
.slider2.lighter {
background: var(--color-m1);
}

.slider2:hover {
opacity: 1;
Expand Down
5 changes: 4 additions & 1 deletion src/essence/Basics/Formulae_/Formulae_.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ var Formulae_ = {
}
},
getExtension: function (string) {
var ex = /(?:\.([^.]+))?$/.exec(string)[1]
const ex = /(?:\.([^.]+))?$/.exec(string)[1]
return ex || ''
},
fileNameFromPath: function (path) {
return path.replace(/^.*[\\\/]/, '').replace(/\.[^/.]+$/, '')
},
pad: function (num, size) {
let s = '000000000000000000000000000000' + num
return s.substr(s.length - size)
Expand Down
144 changes: 85 additions & 59 deletions src/essence/Basics/Layers_/Layers_.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ var L_ = {
searchFile: null,
toolsLoaded: false,
addedfiles: {}, //filename -> null (not null if added)
activeFeature: null,
lastActivePoint: {
layerName: null,
lat: null,
Expand Down Expand Up @@ -133,6 +134,7 @@ var L_ = {
L_.searchStrings = null
L_.searchFile = null
L_.toolsLoaded = false
L_.activeFeature = null
L_.lastActivePoint = {
layerName: null,
lat: null,
Expand Down Expand Up @@ -408,24 +410,30 @@ var L_ = {
}
}
},
disableAllBut: function (name, skipDisabling) {
if (L_.layersNamed.hasOwnProperty(name)) {
var l
disableAllBut: function (siteName, skipDisabling) {
if (L_.layersNamed.hasOwnProperty(siteName)) {
let l
if (skipDisabling !== true) {
for (var i = 0; i < L_.layersData.length; i++) {
for (let i = 0; i < L_.layersData.length; i++) {
l = L_.layersData[i]
if (L_.toggledArray[l.name] == true) {
L_.toggleLayer(l)
if (l.name != 'Mars Overview') L_.toggleLayer(l)
}
if (L_.toggledArray['Mars Overview'] === false) {
if (l.name === 'Mars Overview') L_.toggleLayer(l)
}
}
}
for (var i = 0; i < L_.layersData.length; i++) {
l = L_.layersData[i]
if (L_.toggledArray[l.name] == false) {
if (l.name == name) L_.toggleLayer(l)
}
if (L_.toggledArray['Mars Overview'] == false) {
if (l.name == 'Mars Overview') L_.toggleLayer(l)

for (let n in L_.layersParent) {
if (L_.layersParent[n] === siteName && L_.layersDataByName[n]) {
l = L_.layersDataByName[n]
if (
l.visibility === true && // initial visibility
L_.toggledArray[l.name] === false
) {
L_.toggleLayer(l)
}
}
}
}
Expand Down Expand Up @@ -564,40 +572,42 @@ var L_ = {
},
})
} else if (L_.layersData[i].type != 'header') {
L_.Globe_.litho.addLayer(
L_.layersData[i].type == 'vector'
? 'clamped'
: L_.layersData[i].type,
{
name: s.name,
order: 1000 - L_.layersIndex[s.name], // Since higher order in litho is on top
on: L_.opacityArray[s.name] ? true : false,
geojson: L_.layersGroup[s.name].toGeoJSON(),
onClick: (feature, lnglat, layer) => {
this.selectFeature(layer.name, feature)
},
useKeyAsHoverName: s.useKeyAsName,
style: {
// Prefer feature[f].properties.style values
letPropertiesStyleOverride: true, // default false
default: {
fillColor: s.style.fillColor, //Use only rgb and hex. No css color names
fillOpacity: parseFloat(
s.style.fillOpacity
),
color: s.style.color,
weight: s.style.weight,
radius: s.radius,
if (typeof L_.layersGroup[s.name].toGeoJSON === 'function')
L_.Globe_.litho.addLayer(
L_.layersData[i].type == 'vector'
? 'clamped'
: L_.layersData[i].type,
{
name: s.name,
order: 1000 - L_.layersIndex[s.name], // Since higher order in litho is on top
on: L_.opacityArray[s.name] ? true : false,
geojson: L_.layersGroup[s.name].toGeoJSON(),
onClick: (feature, lnglat, layer) => {
this.selectFeature(layer.name, feature)
},
bearing: s.variables?.markerAttachments?.bearing
? s.variables.markerAttachments.bearing
: null,
},
opacity: L_.opacityArray[s.name],
minZoom: 0, //s.minZoom,
maxZoom: 100, //s.maxNativeZoom,
}
)
useKeyAsHoverName: s.useKeyAsName,
style: {
// Prefer feature[f].properties.style values
letPropertiesStyleOverride: true, // default false
default: {
fillColor: s.style.fillColor, //Use only rgb and hex. No css color names
fillOpacity: parseFloat(
s.style.fillOpacity
),
color: s.style.color,
weight: s.style.weight,
radius: s.radius,
},
bearing: s.variables?.markerAttachments
?.bearing
? s.variables.markerAttachments.bearing
: null,
},
opacity: L_.opacityArray[s.name],
minZoom: 0, //s.minZoom,
maxZoom: 100, //s.maxNativeZoom,
}
)
}
}
}
Expand All @@ -607,23 +617,36 @@ var L_ = {
layer.setStyle(newStyle)
} catch (err) {}
},
select(layer) {
setActiveFeature(layer) {
if (layer && layer.feature && layer.options?.layerName)
L_.activeFeature = {
feature: layer.feature,
layerName: layer.options.layerName,
layer: layer,
}
else L_.activeFeature = null

L_.setLastActivePoint(layer)
L_.resetLayerFills()
L_.highlight(layer)
L_.Map_.activeLayer = layer
Description.updatePoint(L_.Map_.activeLayer)

L_.Globe_.highlight(
L_.Globe_.findSpriteObject(
layer.options.layerName,
layer.feature.properties[layer.useKeyAsName]
),
false
)
L_.Viewer_.highlight(layer)
if (layer) {
L_.Globe_.highlight(
L_.Globe_.findSpriteObject(
layer.options.layerName,
layer.feature.properties[layer.useKeyAsName]
),
false
)
L_.Viewer_.highlight(layer)
}

ToolController_.notifyActiveTool('setActiveFeature', L_.activeFeature)
},
highlight(layer) {
if (layer == null) return
const color =
(L_.configData.look && L_.configData.look.highlightcolor) || 'red'
try {
Expand Down Expand Up @@ -1139,11 +1162,14 @@ var L_ = {
* @param {object} layer - leaflet layer object
*/
setLastActivePoint: function (layer) {
var layerName = layer.hasOwnProperty('options')
? layer.options.layerName
: null
var lat = layer.hasOwnProperty('_latlng') ? layer._latlng.lat : null
var lon = layer.hasOwnProperty('_latlng') ? layer._latlng.lng : null
let layerName, lat, lon
if (layer) {
layerName = layer.hasOwnProperty('options')
? layer.options.layerName
: null
lat = layer.hasOwnProperty('_latlng') ? layer._latlng.lat : null
lon = layer.hasOwnProperty('_latlng') ? layer._latlng.lng : null
}

if (layerName != null && lat != null && layerName != null) {
L_.lastActivePoint = {
Expand Down
Loading

0 comments on commit 2ddfd64

Please sign in to comment.