Mike Priven


Hi All,

I have a vemap loaded in a browser control inside an MFC app and need to have a capability to import a local GeoRSS xml file (from a hard drive) on this map. I read that the feed must be on the web server, and just trying to pass the local "text.xml" into the VEShapeSourceSpecification generates an error "unable to load source file".

Is there a neat trick to get around this limitation of having the xml file on the actual web server

I did consider using XMLHTTP request to open a file, but the callback returns the entire file contents which I then would have to parse to extract each location and add individually to the shape layer. It's probably not a huge deal to implement, but I wanted to see if there was a more elegant way of achieving this.

Thanks,

\Mike




Re: Importing data from a local GeoRSS file

SoulSolutions


No it needs to be a web address, if your running XP pro or Vista then you have IIS. If your running Visual studio then you can use casini - simply open up the folder as a web site.

What the situation your in Mike Is this just for some testing or do you want to be able to have htm file to be run locally on computers

John.







Re: Importing data from a local GeoRSS file

Mike Priven

John,

I have an MFC-based tool that connects and monitors my company's GPS receivers. It opens up a window that loads an IE Active X browser control and loads a locally-generated html page containing a VEMAP which I can then show GPS data on in real-time and also playing back previously logged data. I need to be able to load all positions from a log file onto the map window as well. Since the tool runs on various PC's with various OS's, it can't rely on IIS support. So, I need a non-server solution.

If there's no easy way, I think XML http request on a local file will work just fine, I'll just need to parse it one position at a time, add to a layer, and then show the layer.

Thanks,

\Mike





Re: Importing data from a local GeoRSS file

SoulSolutions

Yes Mike I think your going to have to go down this path. I found this article and code snippets really useful for loading a parsing XML document in javascript:

http://www.webreference.com/programming/javascript/definitive2/index.html

I guess the only positive of this is you can easily customise or enhance what you display and you will have total control over it.

Optionally if you could change the format of your data to the JSON format instead of XML then you can eliminate the whole parsing/navigating the XML document as you can access the data natively/driectly in javascript. That assumes you can load that data from a local file.

I wouldn't recommend it but your could also write the data out as the javascript functions required to add it to the map and simply use the eval() method to simply execute it.

My preference would be the standard XML format for compatibility with other systems or the JSON for better performance.

John.






Re: Importing data from a local GeoRSS file

Mike Priven

Thanks, John. Guess I'll need to go that route, though I wish they'd add a capability to load local files.