Skip to content

Commit

Permalink
Add example to custom url template prompt
Browse files Browse the repository at this point in the history
(closes #3887)
  • Loading branch information
bhousel committed Jun 20, 2017
1 parent 684de28 commit eff9aae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ in the hash portion of the URL:
where the URL can contain the standard tile URL placeholders `{x}`, `{y}` and
`{z}`/`{zoom}`, `{ty}` for flipped TMS-style Y coordinates, and `{switch:a,b,c}` for
DNS multiplexing. Example:
`background=custom:http://{switch:a,b,c}.tiles.mapbox.com/v4/examples.map-4l7djmvo/{z}/{x}/{y}.png`
`background=custom:https://{switch:a,b,c}.tiles.mapbox.com/v4/examples.map-4l7djmvo/{zoom}/{x}/{y}.png`
* `gpx` - A custom URL for loading a gpx track. Specifying a `gpx` parameter will
automatically enable the gpx layer for display. Example:
`gpx=https://tasks.hotosm.org/project/592/task/16.gpx`
Expand Down
2 changes: 1 addition & 1 deletion data/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ en:
switch: Switch back to this background
custom: Custom
custom_button: Edit custom background
custom_prompt: "Enter a tile URL template. Valid tokens are {zoom}, {x}, {y} for Z/X/Y scheme and {u} for quadtile scheme."
custom_prompt: "Enter a tile URL template. Valid tokens are {zoom}, {x}, {y} for Z/X/Y scheme and {u} for quadtile scheme.\n\nExample:\n{example}"
fix_misalignment: Adjust imagery offset
imagery_source_faq: Where does this imagery come from?
reset: reset
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
"switch": "Switch back to this background",
"custom": "Custom",
"custom_button": "Edit custom background",
"custom_prompt": "Enter a tile URL template. Valid tokens are {zoom}, {x}, {y} for Z/X/Y scheme and {u} for quadtile scheme.",
"custom_prompt": "Enter a tile URL template. Valid tokens are {zoom}, {x}, {y} for Z/X/Y scheme and {u} for quadtile scheme.\n\nExample:\n{example}",
"fix_misalignment": "Adjust imagery offset",
"imagery_source_faq": "Where does this imagery come from?",
"reset": "reset",
Expand Down
3 changes: 2 additions & 1 deletion modules/ui/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ export function uiBackground(context) {

function editCustom() {
d3.event.preventDefault();
var template = window.prompt(t('background.custom_prompt'), customTemplate);
var example = 'https://{switch:a,b,c}.tiles.mapbox.com/v4/examples.map-4l7djmvo/{zoom}/{x}/{y}.png';
var template = window.prompt(t('background.custom_prompt', { example: example }), customTemplate);
if (template) {
setCustom(template);
} else {
Expand Down

0 comments on commit eff9aae

Please sign in to comment.