I am looking to use an XML feed that contains tags for longitude and latitude in it as inputs to plot points on my Google Map within Matrix.
I have read that this is possible using the Metadata Keyword Replacements, however I would like to read directly from the Data Source Record Set assets.
Can I use my asset listing to pull through the latitude and longitude onto my Google Map then?
You can accomplish what you are wanting if you forgo the Google Map asset and just use standard Google Maps API code. So you use an asset listing to build the javascript array of locations, then load that up into a Google Map.
Let me know if you are interested and I can provide the code.
It had crossed my mind to use a substitute in place of the Google Map asset so thanks for that Nic, that would be a huge help if you could message me the code for it.
Thanks for the guidance above. So far I've got the first part working correctly where the keyword replacement features in the script tag.
<script type="text/javascript">
var zs_waypoints = [{"longitude": "-0.949461","latitude": "53.267975","title": "A1 northbound between A57/A638 and B6387 | Northbound | Roadworks"},
{"longitude": "-0.949461","latitude": "53.267975","title": "A1 northbound between A57/A638 and B6387 | Northbound | Roadworks"},
{"longitude": "-1.726932","latitude": "55.356712","title": "A1 southbound between A1068 and A697 | Southbound | Roadworks"},
...
];</script>
However, I'm not quite sure how to incorporate these coordinates into zs.js and then also how to create the map using zs.js. I wonder if you could a little more detail on that particular part.
-------
I've managed to get zs.js to create the map, (see screenshot) and I've still got the zs_waypoints array working as above.
However, the array doesnt seem to be populating the pins on the front end. I've tried to track down and debug anything not working properly in FireBug and its not throwing any errors so I'm a bit confused as to where I must have gone wrong.
Cheers
Ellis
-------
Had a bit of success, the part of zs.js that set the colours dependent on the state was crashing the script. Thats a really good idea though so I'll be using that in a slightly different way.
Just a slight expansion to the Google Maps issue I posted above.
Now that I have created the Google Map with a single RSS feed that represents one of England's busiest (and most prone to incident) roads I would like a way of including multiple RSS feeds for other busy roads. However, due to the unprecedented amount of collisions on English roads the RSS feed size is far too large to load all of them at the same time.
I plan to load the Google Map with no feeds on the initial page load, from here users can use checkboxes to tick and submit which roads (feeds) they would like to be plotted. My first thought was to use a structured root node with GET variable to switch which root nodes the Map would use to plot the points, I tested the structured root node on a folder and some test pages and it has worked fine, however when I try and switch the root node to a folder containing the RSS's and tell it to list out each data source record dependent on the GET variable I get my No Results page.
The issue obviously sits in the configuration of the asset listing.
Is there a difference as to how Matrix handles standard assets in comparison to how it handles shadow assets or is there a major difference in set up between listing a dynamic feed and listing standard assets?
Has anyone come across this before?
And lastly, if anyone has tried this before, did they find another way of doing it?
I did try that yeah. It didn't seem to make a difference as the Data Source Record Set are not direct children of the folder that they sit in. They belong to the RSS.
I'm not too sure on this one as it worked just fine for the Folder and Standard Page example but wouldn't for the Folder and RSS.
I did try that yeah. It didn't seem to make a difference as the Data Source Record Set are not direct children of the folder that they sit in. They belong to the RSS.
I'm not too sure on this one as it worked just fine for the Folder and Standard Page example but wouldn't for the Folder and RSS.
You have to make sure the shadow assets are direct children of the root node that you have selected. So, if your root node is a Folder that holds the RSS Data Source asset, the Asset Listing will not find the shadow assets.
I have csv datasource that has lat/long in it, but it seems that Google map listing asset doesn't want to output it on the map even though I've maped %ds__lat% %ds__long% to record set.