View Full Version : La Quinta Inns Site
dteare
10-13-2004, 06:04 PM
I really like what La Quinta did with the map of the USA here: http://www.lq.com/lq/map/index.jsp
Does anyone know how this works? It looks like they used a Draw API to flood-fill during mouse-over events. Is this done directly in Laszlo or using the Flex API directly?
Thanks!
--Dave.
Laszlo doesn't allow the use of Flash or Flex APIs. When you write a Laszlo app, you have to use only the Laszlo APIs.
In lps-2.2 (the current, available version) you can have an irregular hit region. This is the clickregion feature, which (I'm embarrassed to say) is not well documented (as far as I can tell.) That would make it fairly easy to do this now -- you'd just have the clickregion for each view be an art asset that was the shape of the state.
The La Quinta project was done before we had that feature, so what we did instead was to create a list of Objects that indexes screen coordinates in quanitized increments in y and then maps arbitrary x values to a given state. The data structure looks something like this:
data = [ { 0 : null , 22: stateWA, 55:null ....},
{0: null, 18: stateWA, 52: stateID,...
The fades on rollover are done with regular 'ol laszlo opacity animation.
I hope this helps.
Yet another approach would be to embed in Laszlo a carto-map coded in SVG XML .. you can get SVG cartographic coordinates from a number of sources.
but an Adobe SVG viewer plug-in is then needed in each client browser (there is a native SVG viewer in Mozilla).
dteare
10-17-2004, 10:20 AM
We don't need no stinkin' Flex APIs
Woops - I meant to say Flash, not Flex! No insult intended :)
Laszlo doesn't allow the use of Flash or Flex APIs. When you write a Laszlo app, you have to use only the Laszlo APIs.
That's good to know - as long as I can do cool things like this La Quinta site this shouldn't be an issue.
In lps-2.2 (the current, available version) you can have an irregular hit region. This is the clickregion feature, which (I'm embarrassed to say) is not well documented (as far as I can tell.) That would make it fairly easy to do this now -- you'd just have the clickregion for each view be an art asset that was the shape of the state.
This sounds great - but you aren't kidding re: the docs. I can't find anything about it, except that it is implemented in the view class. I am downloading the source code now for some insights to how it was implemented - hopefully I get lucky and the code is documented :)
Regarding the current implementation, did La Quinta use one large image that was carved up into states, or many little images (one for each state) and then "paste" them together? From your description it sounds like you carved a big image into smaller ones, but if that is the case, I don't see how you could opacity animation would work.
Could you please elaborate on both approaches?
Much appreciated!
--Dave.
dteare
10-17-2004, 10:30 AM
Originally posted by d~l
Yet another approach would be to embed in ... SVG ... but an Adobe SVG viewer plug-in is then needed in each client browser (there is a native SVG viewer in Mozilla). [/B]
I have thought about using a SVG & LZX hybrid, but the browser plugin is a concern for me. Most of my users are, well, users :) I don't have faith that they would be able to install it without help.
Another thought I had was to use Java2D inside an applet. I could embed the applet inside LZX frames to make things more beautiful, and most browsers have a JVM plugin already available. However, I do find applets (specifically Swing) very ugly 'out of the box', and don't want to waste my time on improving it considering LZX is so nice already.
Thanks for the ideas. If I elect to go with a hybrid solution, I will post my findings in this forum.
--Dave.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.