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

TileMapServiceImageryProvider can't handle casing differences in tilemapresource.xml #1299

Closed
shunter opened this issue Nov 15, 2013 · 5 comments
Labels
good first issue An opportunity for first time contributors type - bug

Comments

@shunter
Copy link
Contributor

shunter commented Nov 15, 2013

Mentioned on the group: https://groups.google.com/d/msg/cesium-dev/5u0HprX3WQs/6nFctSXdQhYJ

We use getElementsByTagName to retrieve values from the document, but that function is case-sensitive for XML documents, unfortunately. What we can do instead is iterate the nodes in the document and check the node names with a case-insensitive regex.

@andr3nun3s
Copy link
Contributor

I'm picking this one up.

Just to make sure I understand... As an example, should I replace:

var format = xml.getElementsByTagName('TileFormat')[0];

With something like:

var parseTagName = /tileformat/i;
var nodeList = xml.getElementsByTagName("*");

for(var i = 0; i < nodeList.length; i++){
  if(parseTagName.test(nodeList.item(i).nodeName)){
    format = nodeList.item(i);
    break;
  }
}

Or is there a better way to do this?

@shunter
Copy link
Contributor Author

shunter commented Jan 7, 2014

Yes, your approach looks reasonable. You might want to iterate through xml.childNodes instead of querying for all elements. Check the document structure as you go, for example, you can find the TileSets element first, then find the TileSet elements inside. The current code doesn't necessary process the data in document order.

@andr3nun3s
Copy link
Contributor

I believe this issue can be closed.

@kring
Copy link
Member

kring commented Jan 22, 2014

Yep, thanks for addressing it, @Andre-Nunes!

@kring kring closed this as completed Jan 22, 2014
@yy921010
Copy link

everybody i wanna download tilemapresource.xml but i could not find it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue An opportunity for first time contributors type - bug
Projects
None yet
Development

No branches or pull requests

4 participants