Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions configure/src/core/Maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ const useStyles = makeStyles((theme) => ({
lineHeight: 1.33,
letterSpacing: "0.00938em",
},
subtitle3: {
fontSize: "13px !important",
width: "100%",
marginTop: "2px !important",
marginBottom: "8px !important",
color: theme.palette.swatches.grey[400],
whiteSpace: "pre-wrap",
lineHeight: 1.33,
letterSpacing: "0.00938em",
textAlign: "center",
},
text: {
width: "100%",
},
Expand Down Expand Up @@ -244,6 +255,14 @@ const getComponent = (
layer == null ? (tool == null ? configuration : tool) : layer;
let inner;
switch (com.type) {
case "gap":
return (
<div>
<Typography className={c.subtitle3}>
{com.description || ""}
</Typography>
</div>
);
case "text":
inner = (
<TextField
Expand Down Expand Up @@ -503,10 +522,12 @@ const getComponent = (
value={value != null ? value : getIn(directConf, com.field, "")}
onChange={(e) => {
let v = e.target.value;
const min = com.min != null ? com.min : -Infinity;
const max = com.max != null ? com.max : Infinity;
v = Math.max(v, min);
v = Math.min(v, max);
if (v != "") {
const min = com.min != null ? com.min : -Infinity;
const max = com.max != null ? com.max : Infinity;
v = Math.max(v, min);
v = Math.min(v, max);
}
updateConfiguration(forceField || com.field, v, layer);
}}
type="number"
Expand Down
58 changes: 58 additions & 0 deletions configure/src/metaconfigs/tab-ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,64 @@
"min": 0,
"max": 40,
"width": 4
},
{
"field": "msv.worldCopyJump",
"name": "World Copy Jump",
"description": "With this option enabled, the map tracks when you pan to another 'copy' of the world and seamlessly jumps to the original one so that all overlays like markers and vector layers are still visible.",
"type": "checkbox",
"defaultChecked": false,
"width": 4
}
]
},
{
"subname": "Max Bounds",
"components": [
{
"type": "gap",
"width": 4
},
{
"field": "msv.maxBoundsTopLeftLat",
"name": "Max Bounds Top Latitude",
"description": "",
"type": "number",
"width": 4
},
{
"type": "gap",
"width": 4
},
{
"field": "msv.maxBoundsTopLeftLng",
"name": "Max Bounds Left Longitude",
"description": "",
"type": "number",
"width": 4
},
{
"type": "gap",
"width": 4,
"description": "When these options are set, the map restricts the view to the given geographical bounds, bouncing the user back if the user tries to pan outside the view. Defaults to the full extent of the map's projection. All sides must be set to take effect. All 0 is considered off. Units are in decimal degrees and longitude is often [-180, 180]."
},
{
"field": "msv.maxBoundsBottomRightLng",
"name": "Max Bounds Right Longitude",
"description": "",
"type": "number",
"width": 4
},
{
"type": "gap",
"width": 4
},
{
"field": "msv.maxBoundsBottomRightLat",
"name": "Max Bounds Bottom Latitude",
"description": "",
"type": "number",
"width": 4
}
]
},
Expand Down
29 changes: 29 additions & 0 deletions src/essence/Basics/Map_/Map_.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,31 @@ let Map_ = {

let shouldFade = true

let maxBounds = null
if (
!isNaN(L_.configData.msv.maxBoundsTopLeftLat) &&
!isNaN(L_.configData.msv.maxBoundsTopLeftLng) &&
!isNaN(L_.configData.msv.maxBoundsBottomRightLat) &&
!isNaN(L_.configData.msv.maxBoundsBottomRightLng) &&
!(
L_.configData.msv.maxBoundsTopLeftLat === 0 &&
L_.configData.msv.maxBoundsTopLeftLng === 0 &&
L_.configData.msv.maxBoundsBottomRightLat === 0 &&
L_.configData.msv.maxBoundsBottomRightLng === 0
)
) {
maxBounds = [
[
L_.configData.msv.maxBoundsTopLeftLat,
L_.configData.msv.maxBoundsTopLeftLng,
],
[
L_.configData.msv.maxBoundsBottomRightLat,
L_.configData.msv.maxBoundsBottomRightLng,
],
]
}

if (
L_.configData.projection &&
L_.configData.projection.custom === true
Expand Down Expand Up @@ -130,6 +155,8 @@ let Map_ = {
zoomSnap: 0,
fadeAnimation: shouldFade,
//wheelPxPerZoomLevel: 500,
worldCopyJump: L_.configData.msv.worldCopyJump || false,
maxBounds,
})

window.mmgisglobal.customCRS = crs
Expand All @@ -144,6 +171,8 @@ let Map_ = {
//zoomDelta: 0.05,
//zoomSnap: 0,
//wheelPxPerZoomLevel: 500,
worldCopyJump: L_.configData.msv.worldCopyJump || false,
maxBounds,
})
// Default CRS

Expand Down