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

fix Pair tag getStyle() execution failure #80

Closed
wants to merge 5 commits into from
Closed

fix Pair tag getStyle() execution failure #80

wants to merge 5 commits into from

Conversation

QingMings
Copy link

fix Pair tag getStyle() execution failure ,see issus #77

@pdavidc pdavidc added the bug label Feb 17, 2017
@balhar-jakub
Copy link
Contributor

The changes to the Style resolver seems fine to me and all changes associated to this: KmlStyleMap, Pair, StyleResolver.
What I don't understand is why the change in the jszip.js What is the reason behind this change. The rest seems ok for the merge, but I need to understand this one. Could you provide some example of file, which works incorrectly without this change?

@QingMings
Copy link
Author

In KmlFile.js
The 83 line.

83 kmzFile.files.forEach(function (file) {
84 if (file.endsWith(".kml") && rootDocument == null) {
85 if (file.name.endsWith(".kml") && rootDocument == null) {
86 rootDocument = file.asText();
87 }
88 });

The kmlFile.files is a object ,not a array , can‘t use forEach method .
So i change the jszip.js , let it return a Array .
Maybe I'm not doing it right. Just to solve the problem, without considering the rationality.
Sorry for this .

@balhar-jakub
Copy link
Contributor

I missed this one. Don't change the jszip. Instead this code should be changed. It should be working if it is changed to:

Object.keys(kmzFile.files).forEach(function(key){
    var file = kmzFile.files[key];
});

Retrieve all the relevant files and then manage the previous function on each of them. Is it obvious what I am trying to explain?

@QingMings
Copy link
Author

Maybe you can help me with this #84

@QingMings
Copy link
Author

yes, I understand,I will correct it。:)

@QingMings QingMings closed this Mar 1, 2017
@QingMings QingMings deleted the update_kml_Pair_style branch March 1, 2017 05:48
@QingMings QingMings restored the update_kml_Pair_style branch March 1, 2017 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants