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

minor: Not selecting any layers -> invalid javascript #211

Open
carolinux opened this issue Mar 21, 2015 · 5 comments
Open

minor: Not selecting any layers -> invalid javascript #211

carolinux opened this issue Mar 21, 2015 · 5 comments
Assignees
Labels

Comments

@carolinux
Copy link

My first use of the plugin and I forgot to add any layers -> the result was some javascript which was missing a '{'. I think the plugin could warn when trying to do this.

When I actually added a layer, no complaints :)

@tomchadwin
Copy link
Contributor

No, it's important because some people might need simply an embedded OSM. Will investigate.

@carolinux
Copy link
Author

I found the problem. line 1656:

f8.seek(-1, os.SEEK_END)

This deletes the last character, ie the bracket.

@tomchadwin
Copy link
Contributor

So is it incorrect even if some layers are selected and included in the map? We don't want to introduce errors in other circumstances.

@carolinux
Copy link
Author

Yes, apparently this is so to delete the last comma added when layers are added (because the layer code is added with a comma at the end everytime), so that's why it works in the case of existing layers.

@carolinux
Copy link
Author

You can use

",".join(["foo","bar","baz"])

renders foo,bar,baz
no need to worry about the last comma

@tomchadwin tomchadwin added the bug label Mar 23, 2015
@tomchadwin tomchadwin self-assigned this Mar 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants