You're on the right track. Try something like this:
<div ex:role="lens"
...
ex:onshow="initializeMap(this);"
>
...
<div ex:id-subcontent="map-{{value}}"
ex:latlng-content=".latlng"></div>
...
</div>
And include this Javascript code
<script>
function initializeMap(elmt) {
var itemID = elmt.getAttribute("ex:itemID");
var mapDiv = document.getElementById("map-" + itemID);
var latlng = mapDiv.getAttribute("latlng");
... initialize your map ...
}
</script>
There is a caveat. Right now there is no handler for disposing the maps
created inside lenses. That means that when the lenses are disposed
(simply removed from the DOM), the maps might be leaking memory.
David
Ivan Zhidov wrote:
> Yes, the map would be rendered in the lens template at first but I'm
> also looking to popup a map window but need a way to pass 'latLng'
> parameter from Exhibit data into a function call.
>
> What I also noticed is that when lens is rendered, its holding element
> is assigned ex:itemid="1" for Exhibit management.
> I don't have a lot of experience with JS/DHTML but would it make sense
> to assign unique DHMTL id to the values being rendered so you could
> easily retrieve their values from document.getElementById() ?
>
> Ivan
>
> From: David Huynh <[EMAIL PROTECTED]>
> Subject: Re: single item map functionality
> To: General List <[email protected]>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Do you intend to render a map in a lens template?
>
> David
>
> Ivan Zhidov wrote:
>
>> > Its possible in Exhibit to switch to a Map view to see the item
>> listed > on Google Map. Is there a way to display a certain single
>> item on the > map?
>> > Can I control which item gets displayed via JS somehow? If this
>> cannot > be easily done out of the box please give me some direction
>> to follow > to implement this type of functionality.
>> >
>> > Ivan
>
> _______________________________________________
> General mailing list
> [email protected]
> http://simile.mit.edu/mailman/listinfo/general
>
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general