Hi - I have a project (a few, actually already :) that could really benefit from this great package. However, the location data (coords) are in a separate XML file so I can't point MapBuilder to a property on an Umbraco node.
Specifically, I have a Store doctype with a Data property that's a nuPickers XML Prefetch List, selecting a specific element in an XML file.
How would I go about creating another type of Datasource for MapBuilder that would let me select data from an XML file instead of a specific doctype?
E.g.:
Instead of Document Type I'd have Data File
Instead of Title property selection I'd have XPath to select title
Instead of Coordinates property selection I'd have XPath to select coordinates
This will require a lot of new code. You will need to make the datasource selection for XML based source. Then you will need to make new WebAPIs which uses this datasource. A new "RenderMap" method is also required.
Alternatively, if you only wish to use XML for the map, you could just make your own implementation of the WebAPI which takes some parameters, telling it where to find the XML, and which properties to get using XPath. Then simply change the following file:
Is it possible to provide alternate Datasources?
Hi - I have a project (a few, actually already :) that could really benefit from this great package. However, the location data (coords) are in a separate XML file so I can't point MapBuilder to a property on an Umbraco node.
Specifically, I have a Store doctype with a Data property that's a nuPickers XML Prefetch List, selecting a specific element in an XML file.
How would I go about creating another type of Datasource for MapBuilder that would let me select data from an XML file instead of a specific doctype?
E.g.:
/Chriztian
Hi Chriztian
This will require a lot of new code. You will need to make the datasource selection for XML based source. Then you will need to make new WebAPIs which uses this datasource. A new "RenderMap" method is also required.
You can see the RenderMap methods here:
The MapModelHelper here:
And the Frontend WebAPI here:
Alternatively, if you only wish to use XML for the map, you could just make your own implementation of the WebAPI which takes some parameters, telling it where to find the XML, and which properties to get using XPath. Then simply change the following file:
To use this new WebAPI. You won't be able to setup the datasource in the backoffice, but you will still be able to use the Map settings. :-)
Hi Mark,
Perfect answer - thanks a bunch!
/Chriztian
is working on a reply...