Skip to content

Commit

Permalink
Merge pull request #41 from NASA-AMMOS/issue-34
Browse files Browse the repository at this point in the history
Full WMS and Polar Projection support for 2D Map
  • Loading branch information
tariqksoliman authored Apr 15, 2021
2 parents 0f88543 + 6d8c3e2 commit 9947e24
Show file tree
Hide file tree
Showing 13 changed files with 526 additions and 5,571 deletions.
4,985 changes: 0 additions & 4,985 deletions Database/PgSQL_queries/dbexport.pgsql

This file was deleted.

93 changes: 52 additions & 41 deletions config/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,9 @@ function makeLayerBarAndModal(d, level) {
maxnzEl = "none"; maxzEl = "none"; strcolEl = "none"; filcolEl = "none";
weightEl = "none"; opacityEl = "none"; radiusEl = "none"; variableEl = "none";
xmlEl = "none"; bbEl = "none"; vtLayerEl = "none"; vtIdEl = "none"; vtKeyEl = "none"; vtLayerSetStylesEl = "none";
break;
break;
default:
console.warn(`Unknown layer type: ${d.type}`)
}

var barColor;
Expand Down Expand Up @@ -803,6 +805,9 @@ function makeLayerBarAndModal(d, level) {
case "model":
barColor = "rgb(189, 189, 15)";
modelSel = "selected";
break;
default:
console.warn(`Unknown layer type: ${d.type}`);
}

var tileformatTMSSel = "",
Expand Down Expand Up @@ -838,6 +843,7 @@ function makeLayerBarAndModal(d, level) {
visFalseSel = "selected";
visIcon = "none";
break;
default:
}

var togwheadTrueSel = "",
Expand All @@ -852,6 +858,7 @@ function makeLayerBarAndModal(d, level) {
case "false":
togwheadFalseSel = "selected";
break;
default:
}
} else togwheadTrueSel = "selected";

Expand Down Expand Up @@ -899,7 +906,7 @@ function makeLayerBarAndModal(d, level) {
"<p>" +

"<div class='row' style='margin-bottom: 0px;'>" +
"<div id='nameEl' class='input-field col s" + (kindEl == 'none' ? 5 : 3) + " push-s1' style='display: " + nameEl + "'>" +
"<div id='nameEl' class='input-field col s" + (kindEl == 'none' ? 8 : 6) + " push-s1' style='display: " + nameEl + "'>" +
"<input id='Name" + n + "' type='text' class='validate' value='" + unescape(d.name) + "'>" +
"<label for='Name" + n + "'>Layer Name</label>" +
"</div>" +
Expand All @@ -910,7 +917,7 @@ function makeLayerBarAndModal(d, level) {
"</select>" +
"<label>Kind of Layer</label>" +
"</div>" +
"<div id='typeEl' class='input-field col s5 push-s1' style='display: " + typeEl + "'>" +
"<div id='typeEl' class='input-field col s2 push-s1' style='display: " + typeEl + "'>" +
"<select>" +
"<optgroup label='Pseudo Layers'>" +
"<option value='header' " + headerSel + ">Header</option>" +
Expand All @@ -929,15 +936,20 @@ function makeLayerBarAndModal(d, level) {
"</div>" +

"<div class='row' style='margin-bottom: 0px;'>" +
"<div id='urlEl' class='input-field col s5 push-s1' style='display: " + urlEl + "'>" +
"<div id='urlEl' class='input-field col s8 push-s1' style='display: " + urlEl + "'>" +
"<input id='Url" + n + "' type='text' class='validate' value='" + d.url + "'>" +
"<label for='Url" + n + "'>URL</label>" +
"</div>" +
"<div id='demtileurlEl' class='input-field col s5 push-s1' style='display: " + demtileurlEl + "'>" +
"<input id='DemTileUrl" + n + "' type='text' class='validate' value='" + d.demtileurl + "'>" +
"<label for='DemTileUrl" + n + "'>DEM Tile URL</label>" +
"<div id='tileformatEl' class='input-field col s2 push-s1' style='display: " + tileformatEl + "'>" +
"<select>" +
"<option value='tms' " + tileformatTMSSel + ">TMS</option>" +
"<option value='wmts' " + tileformatWMTSSel + ">WMTS</option>" +
"<option value='wms' " + tileformatWMSSel + ">WMS</option>" +
"</select>" +
"<label style='cursor: default;' title='TMS and WMTS: Append \"/{z}/{x}/{y}.png\" to URL\n\nWMS: After service, append \"?layer=<your_layer_name><,another_if_you _want>\" to the URL\nTo override WMS parameters append \"&<wms_param>=<value>\" again to the URL after the layers list.\n\nAll brackets included, quotes are not and <> require custom input.'>Tile Format <i class='mdi mdi-information mdi-14px'></i></label>" +
"</div>" +
"</div>" +

//Model Position
"<div class='row' style='margin-bottom: 0px;'>" +
"<div id='modelLonEl' class='input-field col s3 push-s1' style='display: " + modelLonEl + "'>" +
Expand Down Expand Up @@ -977,24 +989,42 @@ function makeLayerBarAndModal(d, level) {
"</div>" +

"<div class='row' style='margin-bottom: 0px;'>" +
"<div id='legendEl' class='input-field col s3 push-s1' style='display: " + legendEl + "'>" +
"<div id='demtileurlEl' class='input-field col s6 push-s1' style='display: " + demtileurlEl + "'>" +
"<input id='DemTileUrl" + n + "' type='text' class='validate' value='" + d.demtileurl + "'>" +
"<label for='DemTileUrl" + n + "'>DEM Tile URL</label>" +
"</div>" +
"<div id='legendEl' class='input-field col s4 push-s1' style='display: " + legendEl + "'>" +
"<input id='Legend" + n + "' type='text' class='validate' value='" + d.legend + "'>" +
"<label for='Legend" + n + "'>Legend</label>" +
"<label for='Legend" + n + "'>Legend URL</label>" +
"</div>" +
"<div id='tileformatEl' class='input-field col s2 push-s1' style='display: " + tileformatEl + "'>" +
"</div>" +

"<div class='row' style='margin-bottom: 0px;'>" +
"<div id='togwheadEl' class='input-field col s2 push-s1' style='display: " + /*togwheadEl*/ 'none' + "'>" +
"<select>" +
"<option value='tms' " + tileformatTMSSel + ">TMS</option>" +
"<option value='wmts' " + tileformatWMTSSel + ">WMTS</option>" +
"<option value='wms' " + tileformatWMSSel + ">WMS</option>" +
"<option value='true' " + togwheadTrueSel + ">True</option>" +
"<option value='false' " + togwheadFalseSel + ">False</option>" +
"</select>" +
"<label title='TMS and WMTS: Append /{z}/{x}/{y}.png to URL\nWMS: After service, append ?[<your_layer_name>,<another_if_you _want>] to URL\nAll brackets included and <> require custom input.'>Tile Format <i class='mdi mdi-information mdi-14px'></i></label>" +
"<label>Toggles with Header</label>" +
"</div>" +
"<div id='minzEl' class='input-field col s2 push-s1' style='display: " + minzEl + "'>" +
"<input id='Minz" + n + "' type='text' class='validate' value='" + d.minZoom + "'>" +
"<label for='Minz" + n + "'>Minimum Zoom</label>" +
"</div>" +
"<div id='maxnzEl' class='input-field col s2 push-s1' style='display: " + maxnzEl + "'>" +
"<input id='Maxnz" + n + "' type='text' class='validate' value='" + d.maxNativeZoom + "'>" +
"<label for='Maxnz" + n + "'>Maximum Native Zoom</label>" +
"</div>" +
"<div id='maxzEl' class='input-field col s2 push-s1' style='display: " + maxzEl + "'>" +
"<input id='Maxz" + n + "' type='text' class='validate' value='" + d.maxZoom + "'>" +
"<label for='Maxz" + n + "'>Maximum Zoom</label>" +
"</div>" +
"<div id='visEl' class='input-field col s2 push-s1' style='display: " + visEl + "'>" +
"<select>" +
"<option value='true' " + visTrueSel + ">True</option>" +
"<option value='false' " + visFalseSel + ">False</option>" +
"</select>" +
"<label>Visibility</label>" +
"<label>Initial Visibility</label>" +
"</div>" +
"<div id='viscutEl' class='input-field col s2 push-s1' style='display: " + viscutEl + "'>" +
"<input id='Visibilitycutoff" + n + "' type='text' class='validate' value='" + d.visibilitycutoff + "'>" +
Expand All @@ -1004,28 +1034,6 @@ function makeLayerBarAndModal(d, level) {
"<input id='InitialOpacity" + n + "' type='text' class='validate' value='" + ( d.initialOpacity == null ? 1 : d.initialOpacity ) + "'>" +
"<label for='InitialOpacity" + n + "'>Initial Opacity [0 - 1]</label>" +
"</div>" +
"<div id='togwheadEl' class='input-field col s2 push-s1' style='display: " + /*togwheadEl*/ 'none' + "'>" +
"<select>" +
"<option value='true' " + togwheadTrueSel + ">True</option>" +
"<option value='false' " + togwheadFalseSel + ">False</option>" +
"</select>" +
"<label>Toggles with Header</label>" +
"</div>" +
"</div>" +

"<div class='row' style='margin-bottom: 0px;'>" +
"<div id='minzEl' class='input-field col s3 push-s1' style='display: " + minzEl + "'>" +
"<input id='Minz" + n + "' type='text' class='validate' value='" + d.minZoom + "'>" +
"<label for='Minz" + n + "'>Minimum Zoom</label>" +
"</div>" +
"<div id='maxnzEl' class='input-field col s4 push-s1' style='display: " + maxnzEl + "'>" +
"<input id='Maxnz" + n + "' type='text' class='validate' value='" + d.maxNativeZoom + "'>" +
"<label for='Maxnz" + n + "'>Maximum Native Zoom</label>" +
"</div>" +
"<div id='maxzEl' class='input-field col s3 push-s1' style='display: " + maxzEl + "'>" +
"<input id='Maxz" + n + "' type='text' class='validate' value='" + d.maxZoom + "'>" +
"<label for='Maxz" + n + "'>Maximum Zoom</label>" +
"</div>" +
"</div>" +

"<div class='row' style='margin-bottom: 0px;'>" +
Expand Down Expand Up @@ -1269,7 +1277,8 @@ function mmgisLinkModalsToLayersTypeChange(e) {
opacityEl = "none"; radiusEl = "none"; variableEl = "none";
xmlEl = "none"; bbEl = "none"; vtLayerEl = "none"; vtIdEl = "none"; vtKeyEl = "none"; vtLayerSetStylesEl = "none";
break;

default:
console.warn(`Unknown selected layer type`)
}

//Set modal bottom color
Expand All @@ -1281,16 +1290,16 @@ function mmgisLinkModalsToLayersTypeChange(e) {
mainThis.find("#typeEl").css("display", typeEl);
mainThis.find("#kindEl").css("display", kindEl);
if (kindEl == "none")
mainThis.find("#nameEl").removeClass("s3").addClass("s5");
else mainThis.find("#nameEl").removeClass("s5").addClass("s3");
mainThis.find("#nameEl").removeClass("s6").addClass("s8");
else mainThis.find("#nameEl").removeClass("s8").addClass("s6");
mainThis.find("#urlEl").css("display", urlEl);
mainThis.find("#demtileurlEl").css("display", demtileurlEl);
mainThis.find("#legendEl").css("display", legendEl);
mainThis.find("#tileformatEl").css("display", tileformatEl);
mainThis.find("#visEl").css("display", visEl);
mainThis.find("#viscutEl").css("display", viscutEl);
mainThis.find("#initOpacEl").css("display", initOpacEl);
mainThis.find("#togwheadEl").css("display", togwheadEl);
//mainThis.find("#togwheadEl").css("display", togwheadEl);
mainThis.find("#minzEl").css("display", minzEl);
mainThis.find("#maxnzEl").css("display", maxnzEl);
mainThis.find("#maxzEl").css("display", maxzEl);
Expand Down Expand Up @@ -2084,6 +2093,8 @@ function save() {
$("#toast_warningm6").parent().css("background-color", "#aeae09");
}
break;
default:
console.warn(`Unknown modal type: ${modalType}`);
}

//This is now the proper spelling and 'broke' is the misspelling
Expand Down
27 changes: 16 additions & 11 deletions docs/pages/markdowns/Layers_Tab.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Header layers contain no content but allows other layers to be grouped underneat
_type:_ string
The unique display name and identifier of the layer. It must be unique and contain no special characters.

#### Visibility
#### Initial Visibility

_type:_ bool
Whether the contents of this header are possibly visible initially.
Expand Down Expand Up @@ -92,10 +92,10 @@ The format of the tiles.

- TMS: Tile Map Service tiles are 256x256 sized images hierarchically organized by zoom level and referenced with x and y coordinates. These are the standard format for web tiles and are the format that MMGIS's auxiliary tiling scripts output. Append `/{z}/{x}/{y}.png` to your `URL`.
- WMTS: Web Map Tile Service is the same exact concept as TMS but it has an inverted Y-axis. Just like TMS, append `/{z}/{x}/{y}.png` to your `URL`.
- WMS: Web Map Service tiles are a popular way of publishing maps by professional GIS software. This format is similar to the previous two formats, but more generic and not so well optimized for use in web maps. A WMS image is defined by the coordinates of its corners. A layer (or list of layers) should be provided as an options by appending `?[<your_layer_name>,<another_if_you _want>]` to your `URL`.
_Example URL: `http://ows.mundialis.de/services/service?[TOPO-WMS,OSM-Overlay-WMS]`_
- WMS: Web Map Service tiles are a popular way of publishing maps by professional GIS software. This format is similar to the previous two formats, but more generic and not so well optimized for use in web maps. A WMS image is defined by the coordinates of its corners. A layer (or list of layers) should be provided as an options by appending `?layers=<your_layer_name><,another_if_you _want>` to your `URL`. To override WMS parameters append `&<wms_param>=<value>` again to the `URL` after the "layers" parameters.
_Example URL: `http://ows.mundialis.de/services/service?layers=TOPO-WMS,OSM-Overlay-WMS`_

#### Visibility
#### Initial Visibility

_type:_ bool
Whether the layer is on initially.
Expand Down Expand Up @@ -158,12 +158,17 @@ A file path like URL but pointing to a Digital Elevation Map tileset generated b
_type:_ string
An absolute or relative file path pointing to a `legend.csv` that describes the symbology of the layer. Please see the Legend Tool to see how to form a `legend.csv`.

#### TMS
#### Tile Format

_type:_ bool
The format of the tiles. If TMS is false, it assumes WMS tiles. The main difference between TMS and WMS is that their Y-axes are inverted.
_type:_ enum [TMS, WMTS, WMS]
The format of the tiles.

- TMS: Tile Map Service tiles are 256x256 sized images hierarchically organized by zoom level and referenced with x and y coordinates. These are the standard format for web tiles and are the format that MMGIS's auxiliary tiling scripts output. Append `/{z}/{x}/{y}.png` to your `URL`.
- WMTS: Web Map Tile Service is the same exact concept as TMS but it has an inverted Y-axis. Just like TMS, append `/{z}/{x}/{y}.png` to your `URL`.
- WMS: Web Map Service tiles are a popular way of publishing maps by professional GIS software. This format is similar to the previous two formats, but more generic and not so well optimized for use in web maps. A WMS image is defined by the coordinates of its corners. A layer (or list of layers) should be provided as an options by appending `?layers=<your_layer_name><,another_if_you _want>` to your `URL`. To override WMS parameters append `&<wms_param>=<value>` again to the `URL` after the "layers" parameters.
_Example URL: `http://ows.mundialis.de/services/service?layers=TOPO-WMS,OSM-Overlay-WMS`_

#### Visibility
#### Initial Visibility

_type:_ bool
Whether the layer is on initially.
Expand Down Expand Up @@ -239,7 +244,7 @@ A relative to the mission directoty or absolute file path to a Digital Elevation
_type:_ string
An absolute or relative file path pointing to a `legend.csv` that describes the symbology of the layer. Please see the Legend Tool to see how to form a `legend.csv`.

#### Visibility
#### Initial Visibility

_type:_ bool
Whether the layer is on initially.
Expand Down Expand Up @@ -291,7 +296,7 @@ A file path that points to a geojson. If the path is relative, it will be relati
_type:_ string
An absolute or relative file path pointing to a `legend.csv` that describes the symbology of the layer. Please see the Legend Tool to see how to form a `legend.csv`.

#### Visibility
#### Initial Visibility

_type:_ bool
Whether the layer is on initially.
Expand Down Expand Up @@ -449,7 +454,7 @@ A z-axis rotation in radians to orient the model.
_type:_ float _optional_
A scaling factor to resize the model.

#### Visibility
#### Initial Visibility

_type:_ bool
Whether the layer is on initially.
Expand Down
Loading

0 comments on commit 9947e24

Please sign in to comment.