View Full Version : Creating a dynamic map view/panel from json data form a link in a detailed view

28 Sep 2011, 10:51 AM
I would like to create a map view, but the trigger would be a simple 'href' link with in text content.
How would I go about this.
I have create a map view/page, that is accessed on a simple
But my next one is that i have this list that opens up a detailed view page, in this detailed view I have a link to a map, but this map link like the details page views details are all different depending which item within the list you click on, the list/page details are with in a json file.
I am serving up my link in a template to something like

'<tpl for="."><div id="list-map"><a href="#{mapDetails}">Map</a></div></tpl>'+Now I could / probably server up several map views for each link but as this list can be either lots or minimal, i though best to see if its possible to use a single map view page and pass the map coordinates to this one map view, so reducing the amount of map pages and page loads etc.
So if anyone could possibel advise or link me up with a solution or if at all not possible.
Rather than have the json file contain: "mapDetails":"#home/mapView01"... "mapDetails":"#home/mapView02".. adding a differnet page view for each list item, i could have the map coordinates
"mapLong":"50.838783", "mapLat":"-9.92922"
so then passing these to the map view to then display.
Many Thanks