Does anyone know if I can use the "Onshow" of the lens to capture
variables?

I tried
<div class="map-lens" ex:role="lens" ex:onshow="dostuff"
style="display: none;">

and in the function:

function dostuff() {
 var lat = window.database.getObject("ex:itemid","streetviewLat");
 var lon = window.database.getObject("ex:itemid","streetviewLon");
    alert("here");
        }

which does not seem to do anything either...



On Jul 9, 9:19 am, martin <mwcourte...@yahoo.com> wrote:
> Has anyone used "window.database.getObject(id,"somevalue") " ?
> or know how one would go about grabbing one of the values of the
> exhibit such as:
> <span ex:content=.label> </span>; and using it globally?
> I'm not a javascript programmer,so any help/examples would be
> appreciated
>
> On Jul 7, 5:33 pm, martin <mwcourte...@yahoo.com> wrote:
>
>
>
> > Ok Thanks David,
> >  I am not quite getting it, the value appears empty.
> > I have a test page at:http://www.courtenay.widget-it.com/parks/
> > I tried assigning the variable lat and lon as you suggested but they
> > appear empty.
> > The park label is : "Pinegrove Park" , that is the only one I have
> > values for ".streetviewLat" and "streetviewLon"
> > you can see the regular streetview works (the whole link is in the
> > database) when I shell out to a new browser window, but not when I try
> > pass the variables.
> > any help greatly appreciated :)
> > Martin
>
> > On Jul 7, 4:24 pm, David Karger <kar...@mit.edu> wrote:
>
> > >http://api.simile-widgets.org/exhibit/2.2.0/scripts/data/database.js
>
> > > but you shouldn't need to find it; just invoke it.
>
> > > On 7/7/2010 7:07 PM, martin wrote:
>
> > > > Thanks for the info David,
> > > > where do I find database.js ?
> > > > it does not appear to live 
> > > > in:http://api.simile-widgets.org/exhibit/2.2.0/database.js
> > > > which is where I am currently loading my exhibit from...
>
> > > > Martin
>
> > > > On Jul 7, 3:22 pm, "David R. Karger"<kar...@mit.edu>  wrote:
>
> > > >> In database.js
>
> > > >> Exhibit.Database._Impl.prototype.getObject = function(s, p)
>
> > > >> returns the value of property p of subject (id) s.
>
> > > >> the database is stored in window.database
>
> > > >> so window.database.getObject(id,"streetviewLat") should do what you 
> > > >> want.
>
> > > >> martin wrote:
>
> > > >>> How would I go about getting the value of:<span ex:content=.label>  </
> > > >>> span>; for instance and passing that value to a javascript ?
>
> > > >>> for example I am trying to grab latitude and logitude from a Exhibit
> > > >>> Map:
> > > >>> ==============
> > > >>> <script type="text/javascript">
> > > >>>   var lat =<span ex:content=.streetviewLat>  </span>;
> > > >>>   var lon =<span ex:content=.streetviewLon>  </span>;
> > > >>>   var myPano;
>
> > > >>>    function initialize() {
> > > >>>    var myPano = new
> > > >>> GStreetviewPanorama(document.getElementById("pano"));
> > > >>>    fenwayPark = new GLatLng(lat,lon);
> > > >>>    myPOV = {yaw:147.19,pitch:-0.23};
> > > >>>    myPano.setLocationAndPOV(fenwayPark, myPOV);
> > > >>>    GEvent.addListener(myPano, "error", handleNoFlash);
> > > >>> }</script>
> > > >>> ==============
> > > >>> so that I can open a streetview window from the map...
> > > >>> I must be missing something, why is this so difficult?- Hide quoted 
> > > >>> text -
>
> > > >> - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To post to this group, send email to simile-widg...@googlegroups.com.
To unsubscribe from this group, send email to 
simile-widgets+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.

Reply via email to