File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
manager_dashboard/manager_dashboard/js
mapswipe_workers/mapswipe_workers/project_types/base Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -172,16 +172,18 @@ function checkImageryUrl() {
172
172
// check if url A contains the placeholders when using custom imagery
173
173
urlA = document . getElementById ( "tileServerAUrl" ) . value
174
174
nameA = document . getElementById ( "tileServerAName" ) . value
175
- if ( nameA === "custom" & ( ! urlA . includes ( "{x}" ) | ! urlA . includes ( "{y}" ) | ! urlA . includes ( "{z}" ) ) ) {
176
- alert ( "The imagery url A must contain {x}, {y} and {z} placeholders." )
175
+ if ( nameA === "custom" & ( ! urlA . includes ( "{z}" ) | ! urlA . includes ( "{ x}") | ( ! urlA . includes ( "{y}" ) & ! urlA . includes ( "{-y}" ) ) ) ) {
176
+ alert ( "The imagery url A must contain {x}, {y} (or {-y}) and {z} placeholders." + urlA )
177
177
return false
178
178
}
179
179
180
+ console . log ( urlA . includes ( "{x}" ) )
181
+
180
182
// check if url B contains the placeholders when using custom imagery
181
183
urlB = document . getElementById ( "tileServerBUrl" ) . value
182
184
nameB = document . getElementById ( "tileServerBName" ) . value
183
- if ( nameB === "custom" & ( ! urlB . includes ( "{x}" ) | ! urlB . includes ( "{y}" ) | ! urlB . includes ( "{z}" ) ) ) {
184
- alert ( "The imagery url B must contain {x}, {y} and {z} placeholders." )
185
+ if ( nameB === "custom" & ( ! urlB . includes ( "{z}" ) | ! urlB . includes ( "{ x}") | ( ! urlB . includes ( "{y}" ) & ! urlB . includes ( "{-y}" ) ) ) ) {
186
+ alert ( "The imagery url B must contain {x}, {y} (or {-y}) and {z} placeholders." + urlB )
185
187
return false
186
188
}
187
189
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ def __init__(self, tile_server_dict):
21
21
# check if url contains the right place holders
22
22
if not self .check_imagery_url ():
23
23
raise CustomError (
24
- f"The imagery url { self .url } must contain {{x}}, {{y}} and {{z}} or "
25
- "the {quad_key} placeholders."
24
+ f"The imagery url { self .url } must contain {{x}}, {{y}} (or {{-y}}) "
25
+ "and {{z}} or the {quad_key} placeholders."
26
26
)
27
27
28
28
# set api key
@@ -47,6 +47,8 @@ def check_imagery_url(self):
47
47
"""Check if imagery url contains xyz or quad key placeholders."""
48
48
if all ([substring in self .url for substring in ["{x}" , "{y}" , "{z}" ]]):
49
49
return True
50
+ elif all ([substring in self .url for substring in ["{x}" , "{-y}" , "{z}" ]]):
51
+ return True
50
52
elif "{quad_key}" in self .url :
51
53
return True
52
54
else :
You can’t perform that action at this time.
0 commit comments