Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UrlTemplateImageryProvider #2709

Closed

Conversation

kaktus40
Copy link
Contributor

Hello,
in response to this question, I made some modifications on TileMapServiceImageryProvider. Now this provider accepts schema in his options that will be used to request a server.

For example if the file server structure to request is "revX/Y/Z" and the extension is gif where:

  • revX is the reverse abscissa of tiles ("tilingScheme.getNumberOfXTilesAtLevel(level) - x - 1" in code),
  • Y is the ordinate of tiles,
  • Z is the level of tiles;

then the code to access to the tiles of the server is

var tms = new Cesium.TileMapServiceImageryProvider({
        url : 'URL/of/TMS',
        fileExtension: 'gif',
        schema: '{revX}/{Y}/{Z}'
     });

then tms.requestImage(3, 1, 2) should request the url "URL/of/TMS/0/1/2.gif" instead of "URL/of/TMS/2/3/2.gif"

@kring
Copy link
Member

kring commented May 18, 2015

Thanks @kaktus40. This is very useful. I think it's a bit odd to give TileMapServiceImageryProvider this capability, though. It would be better to create a new imagery provider, maybe called UrlTemplateImageryProvider, that takes a URL template much like the schema you've implemented here. The fileExtension property can go away, too, because the extension can be part of the template. Would you be willing to work on something like that?

@kring
Copy link
Member

kring commented May 18, 2015

So basically, your example above would instead look like:

var provider = new Cesium.UrlTemplateImageryProvider({
    url: 'URL/of/TMS/{reverseX}/{Y}/{Z}.gif',

});

(In my example I've also renamed revX to reverseX because we try to avoid abbreviations in Cesium.)

@kaktus40
Copy link
Contributor Author

Hello,
I can work on it. Do you think there could be a work to do with OGCHelper?

On 18/05/2015 05:02, Kevin Ring wrote:

So basically, your example above would instead look like:

|var provider = new Cesium.UrlTemplateImageryProvider({
url: 'URL/of/TMS/{reverseX}/{Y}/{Z}.gif',

});
|

(In my example of always renamed |revX| to |reverseX| because we try
to avoid abbreviations in Cesium.)


Reply to this email directly or view it on GitHub
#2709 (comment).

@kring
Copy link
Member

kring commented May 18, 2015

Sorry, I've been putting off a thorough review of your OGCHelper for too long. I'll at least add some initial thoughts over there (#2362).

@pjcozzi
Copy link
Contributor

pjcozzi commented May 18, 2015

+1 for the new design. Users will definitionally want this. Thanks for the contribution, @kaktus40.

@kaktus40
Copy link
Contributor Author

Hello I follow your prescriptions and create a new ImageryProvider based on url template.

@kring
Copy link
Member

kring commented May 29, 2015

Thanks @kaktus40, this looks great! I'm going to pull it into a separate branch and tweak a few things before merging it. Do we already have a CLA for you? Can you add yourself to CONTRIBUTORS.md in this pull request?

@kaktus40
Copy link
Contributor Author

Hello, I have send a CLA in december 2014 or january 2015 and I made a pull with adding myself in the CONTRIBUTORS.md

@kring
Copy link
Member

kring commented May 29, 2015

Great, thanks!

@kring kring changed the title adding schema to TileMapServiceImageryProvider Add UrlTemplateImageryProvider Jun 3, 2015
@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 9, 2015

Moving this discussion to #2795.

@pjcozzi pjcozzi closed this Jun 9, 2015
@kaktus40 kaktus40 deleted the TMSImageryProviderMoreVersatile branch June 17, 2015 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants