Im not certain if this is the right forum for this, but I need to be able to have the CMS upload XML (KML) data into the system, then i will need to extract the KML data to apply it to either Google.Maps or Bing.Maps.
So.. My current thinking is that i will need to use a user control to open the xml files and then process the nodes to extract the points in a way that shapes can be drawn on the map.
The question I have - and i am a little new to umbraco, is... Does this seem to be a resonable option. All of the geo data is currently stored in a number of different KML files. To process the files it seems that i need to upload them into umbraco via something like the file upload datatype.
Thoughs and ideas are welcome. Is there a better option. Is this something i can do with XSLT? Im at a bit of a loss here.
The simplest option would probably be to use an Upload datatype to upload the XML files, then in XSLT you can use the umbraco.library:GetXmlDocumentByUrl extension to grab the contents into parseable XML. From there you can do what you please with it from your XSLT macro :) Make sense?
Allow the user to use the filupload datatype to upload an xml document
Use the documents friendly ulr to load the document into an xslt macro using the GetXmlDocumentByUrl method.
Have the macro generate the "text" to be merged back into the page The XML will produce two outputs a. A menu to load/remove the KML dynamically from a map b. Generate the "javascript array" into a standard "script tag" to link the menu with the mapping api.
Does that sound about right?
Thanks in advance (I think you have probably made my life much easier!!)
I'd love to tell you I am doing well, however I have bumped into a problem. I suspect it is with the KML having a bad declaration but I am really not certain.
Working with External Data (file based xml) Q..
Im not certain if this is the right forum for this, but I need to be able to have the CMS upload XML (KML) data into the system, then i will need to extract the KML data to apply it to either Google.Maps or Bing.Maps.
So.. My current thinking is that i will need to use a user control to open the xml files and then process the nodes to extract the points in a way that shapes can be drawn on the map.
The question I have - and i am a little new to umbraco, is... Does this seem to be a resonable option. All of the geo data is currently stored in a number of different KML files. To process the files it seems that i need to upload them into umbraco via something like the file upload datatype.
Thoughs and ideas are welcome. Is there a better option. Is this something i can do with XSLT? Im at a bit of a loss here.
Thanks in advance.
Rob
Hi Rob,
The simplest option would probably be to use an Upload datatype to upload the XML files, then in XSLT you can use the umbraco.library:GetXmlDocumentByUrl extension to grab the contents into parseable XML. From there you can do what you please with it from your XSLT macro :) Make sense?
-Tom
Tom.
Thanks. I think you may have solved the problem.
So.. to paraphrase..
The XML will produce two outputs
a. A menu to load/remove the KML dynamically from a map
b. Generate the "javascript array" into a standard "script tag" to link the menu with the mapping api.
Does that sound about right?
Thanks in advance (I think you have probably made my life much easier!!)
Rob
Hi Rob,
Yep, that sounds right - let us know how you get along.
-Tom
I'd love to tell you I am doing well, however I have bumped into a problem. I suspect it is with the KML having a bad declaration but I am really not certain.
I posted a much shortened version of the KML and the XLST macro to this link http://our.umbraco.org/forum/developers/xslt/36382-Problem-processing-XML-file
If you have the time and could give it a look I would really appreciate it! The rss feed from the BBC worked great, but the KML is not processing at all.
I FOUND THE ANSWER - I Will post to the other link, but i suspect i am now on the way!
I think it was this line <gx:balloonVisibility>1</gx:balloonVisibility>
Rob.
is working on a reply...