Opened 15 years ago
Closed 14 years ago
#3983 closed enhancement (fixed)
Custom url syntax
Reported by: | Bürste | Owned by: | framm |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core imagery | Version: | |
Keywords: | Cc: | delta_foxtrot2 |
Description
Would be great if we don't need an apache server with mod_rewrite just to use the nearmap datasource with slippymap.
The possibility to change the <url>/<z>/<x>/<y>.jpg behavior to anything we want like <url>&x=<x>&y=<y>&z=<z>
Attachments (1)
Change History (17)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
I don't want to learn a new language just to add a easy to build in feature in existing code. You might just add a placeholder like $x $y $z if they are present in the url they default behavior has to be overwritten.
comment:3 by , 15 years ago
Priority: | major → normal |
---|---|
Type: | defect → enhancement |
comment:4 by , 15 years ago
Cc: | added |
---|
I was planning to update the slippymap plugin to have custom parameters, but this seems like a better idea, I think I'll try and make a patch for this instead, so that JOSM can work almost identically to potlatch in this respect.
follow-up: 6 comment:5 by , 15 years ago
This is the current url format for potlatch:
http://www.nearmap.com/maps/nml=Vert&zxy=!,!,!&nmd=20091031
Where the !'s get replaced with the z, x and y values respectively
comment:6 by , 15 years ago
Replying to delta_foxtrot2:
This is the current url format for potlatch:
http://www.nearmap.com/maps/nml=Vert&zxy=!,!,!&nmd=20091031
Where the !'s get replaced with the z, x and y values respectively
Does this mean z, x and y have to appear in the url *in that order*? This is still suboptimal.
comment:7 by , 15 years ago
Sorry, I shouldn't have suggested to do it exactly like that, but there is no reason not to have a potlatch compatible mode either...
We could support both the following:
http://www.nearmap.com/maps/nml=Vert&zxy=!,!,!&nmd=20091031
http://www.nearmap.com/maps/nml=Vert&zxy=!z!,!x!,!y!&nmd=20091031
comment:8 by , 15 years ago
I managed to get this to work, although I did it in slightly a lazy way in that you can't supply a completely custom URL, I just added a type option for custom URLs, so you could tell the system to send /z/x/y.png or &x=$x&y=$y&z=$z and the URL you feed the URL section you can specify the date. Needs to be fixed up to do proper URL parsing etc, but works well enough to avoid needing to user morb_au's apache redirection hack.
slippymap.custom_tile_source_1.ext=jpg
slippymap.custom_tile_source_1.name=Nearmap with custom date
slippymap.custom_tile_source_1.url=http://www.nearmap.com/maps/nml=Vert&nmd=20091031
slippymap.custom_tile_source_1.type=URL
I've uploaded a patch, and you can download a copy of the current slippymap plugin from the latest branch here:
http://map-data.bigtincan.com/data/slippymap.jar
I doubt the plugin will work against the current stable version.
comment:9 by , 15 years ago
slippymap.custom_tile_source_1.ext=jpg slippymap.custom_tile_source_1.name=Nearmap with custom date slippymap.custom_tile_source_1.url=http://www.nearmap.com/maps/nml=Vert&nmd=20091031 slippymap.custom_tile_source_1.type=URL
comment:10 by , 15 years ago
I just realised this updated functionality could be used to reduce duplicate functions for some of the pre-defined URLs...
comment:11 by , 15 years ago
Also the slippymap plugin really needs to be redone so it works more like the WMS plugin where you can load layers on demand... but that's a diff issue and as a result updating custom URLs etc probably need you to reload JOSM to make them active.
comment:12 by , 15 years ago
There is a potential issue with the current patch, it assumes &z=.... where as ?z= might be needed, the URL will need to be checked to see if ? has been used or not and use ? or &, although the nearmap URL doesn't use a ? at all and works fine with just &'s...
comment:13 by , 15 years ago
Oh and the tile cache retains anything already downloaded even if the URL changes, not sure where to start looking on how to fix this.
comment:14 by , 15 years ago
And the custom URL option is limited to zoom=18, but nearmap can mostly do zoom=21 and in Perth CBD it can do zoom=22...
comment:15 by , 15 years ago
Thanks John but a couple of problems: 1) as you said, "needs to be fixed up to do proper URL parsing" and 2) using the "type" member with a value of "URL" as opposed to "image" is not intuitive. "image_URL" would be an improvement. Nevertheless, the patch is an improvement, I guess, but (as you know, anyway) not a complete solution.
comment:16 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
See Maps. We adopted the {x}, {y} {zoom} syntax from WMS URL's.
Another option would be to just code up your own tile source class. Those don't have any limits on formatting. They're also really simple to code.