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

Problem with .json file converted from .osm #104

Open
ledaihpvn opened this issue Apr 17, 2012 · 5 comments
Open

Problem with .json file converted from .osm #104

ledaihpvn opened this issue Apr 17, 2012 · 5 comments

Comments

@ledaihpvn
Copy link

Hello,
I met a problem, here is the steps to that:

  • I went to http://www.openstreetmap.org and exported an area with OpenStreetMap XML Data, so I got an .osm file.
  • I used xml2json to convert this file to .json file using command: xml2json -t xml2json map.osm -o map.json, so I got an .json file
  • I put that .json file to cartagen client directory and edited the index.html. After that I opened this index.html using newest Firefox but it does not render the map.
    Here are link to my .osm, .json and index.html file. Please take a look and tell me why it does not work. Thanks in advance :)
    http://www.mediafire.com/?z2k755a6b8i4rz1
@jywarren
Copy link
Owner

can you install firebug and display the errors you see in the javascript console? you can also do this in the native javascript console.

If you run it all locally, browsers don't let you load data from the local filesystem. You may need to put it online for it to work.

what OS are you? Windows?

If it's a permissions issue due to local files, you'll see something like this (from Chrome):

XMLHttpRequest cannot load file:///home/jeff/Desktop/cartagen-bug/jywarren-cartagen-b74f982/style.gss. Origin null is not allowed by Access-Control-Allow-Origin.
Refused to get unsafe header "X-JSON"
XMLHttpRequest cannot load file:///home/jeff/Desktop/cartagen-bug/jywarren-cartagen-b74f982/map.json. Origin null is not allowed by Access-Control-Allow-Origin.
3Refused to get unsafe header "X-JSON"

@ledaihpvn
Copy link
Author

I'm using ubuntu 11.04, FF displays map fine with the default Rome, and console does not have error, just caution: "Use of getAttributeNodeNS() is deprecated. Use getAttributeNS() instead." I know the permission issue on Chrome, but FF does not meet this problem, so I guess the issue is from the .json file.

@jywarren
Copy link
Owner

try using an online JSON validator to find your problem, that's a good
theory

On Wed, Apr 18, 2012 at 1:08 AM, ledaihpvn <
[email protected]

wrote:

Use of getAttributeNodeNS() is deprecated. Use getAttributeNS() instead

@ledaihpvn
Copy link
Author

I tried it with http://jsonlint.com/ and it's valid. Could you download my file and check please?

@jywarren
Copy link
Owner

jywarren commented May 9, 2012

sorry, let this slip by. Are you displaying locally then? Have you tried doing it remotely?

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

No branches or pull requests

2 participants