<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi Len,<div>I stuck your code the following function definition but even thought the popup shows up it does not contain any information.</div><div><br></div><div>this.onLoadedMapbook = function(mapbookXML) {</div><div>#your hover code</div><div><br></div><div>}</div><div><br></div><div> I changed the line setting the url to the identify.php like this to suite my local settings.</div><div> </div><div>var url = 'http://localhost/moosecache2/php/identify.php?';</div><div><br></div><div>I am not sure if there is something else I need to do to. I have seen it work on your site so it should work on my I suppose.</div><div><br></div><div>Franz</div><div><br></div><div><br></div><div>> From: lkne@houstoneng.com<br>> To: bfraser@geoanalytic.com<br>> Date: Thu, 3 Jun 2010 15:40:50 +0000<br>> CC: geomoose-users@lists.sourceforge.net<br>> Subject: Re: [Geomoose-users] Mouseover map area to show pop up or link<br>> <br>> Performance seems ok, you can try it at http://dev.houstoneng.net/geomoose.html. Hover over a parcel for 1 second and you should get a popup. It's different than passing over a marker in OL because the handler is triggered after a pause in mouse movement vs. going over the marker. The downside is there will be a lot of calls back to the server (could be an issue on a high use app) and in the case of parcels, the number of popups could get annoying to the person looking at the map. Might work better with point data.<br>> <br>> Len<br>> <br>> -----Original Message-----<br>> From: Brent Fraser [mailto:bfraser@geoanalytic.com] <br>> Sent: Thursday, June 03, 2010 10:05 AM<br>> To: Len Kne<br>> Cc: Geomooselist<br>> Subject: Re: [Geomoose-users] Mouseover map area to show pop up or link<br>> <br>> Len,<br>> <br>> That's impressive! How's the performance?<br>> <br>> Brent<br>> <br>> Len Kne wrote:<br>> > One way would be to use OL Hover handler - see <br>> > http://openlayers.org/dev/examples/hover-handler.html. Basically it <br>> > is going to make an ajax call to the identify service when the cursor <br>> > hovers over a spot for a set time. The script below works in my <br>> > testing environment... it could be enabled as a tool or in onLoadedMapbook().<br>> > <br>> > <br>> > <br>> > Len<br>> > <br>> > <br>> > <br>> > // Hover support on WMS and MapServr layers<br>> > <br>> > var popup;<br>> > <br>> > OpenLayers.Control.Hover = <br>> > OpenLayers.Class(OpenLayers.Control, { <br>> > <br>> > defaultHandlerOptions: {<br>> > <br>> > 'delay': 500,<br>> > <br>> > 'pixelTolerance': 20,<br>> > <br>> > 'stopMove': false<br>> > <br>> > },<br>> > <br>> > <br>> > <br>> > initialize: function(options) {<br>> > <br>> > this.handlerOptions = OpenLayers.Util.extend(<br>> > <br>> > {}, this.defaultHandlerOptions<br>> > <br>> > );<br>> > <br>> > OpenLayers.Control.prototype.initialize.apply(<br>> > <br>> > this, arguments<br>> > <br>> > );<br>> > <br>> > this.handler = new OpenLayers.Handler.Hover(<br>> > <br>> > this,<br>> > <br>> > {'pause': this.onPause, 'move': this.onMove},<br>> > <br>> > this.handlerOptions<br>> > <br>> > );<br>> > <br>> > },<br>> > <br>> > <br>> > <br>> > onPause: function(evt) {<br>> > <br>> > var feature = <br>> > Map.getLonLatFromPixel(evt.xy);<br>> > <br>> > var url = <br>> > '/php/identify.php?';<br>> > <br>> > var layersArray = <br>> > GeoMOOSE.getVisibleLayers();<br>> > <br>> > layers = <br>> > layersArray.join(':');<br>> > <br>> > var requestOptions = <br>> > OpenLayers.Request.GET({<br>> > <br>> > url: <br>> > url,<br>> > <br>> > params: <br>> > {'shape': 'POINT(' + feature.lon + ' ' + feature.lat + ')',<br>> > <br>> > <br>> > 'layers': layers,<br>> > <br>> > <br>> > '_moosetime': (new Date()).getTime() },<br>> > <br>> > async: <br>> > false<br>> > <br>> > });<br>> > <br>> > <br>> > <br>> > <br>> > if(requestOptions.responseText) {<br>> > <br>> > popup <br>> > = new OpenLayers.Popup.FramedCloud("wms",<br>> > <br>> > <br>> > Map.getLonLatFromPixel(evt.xy),<br>> > <br>> > <br>> > null,<br>> > <br>> > <br>> > requestOptions.responseText,<br>> > <br>> > <br>> > null, false);<br>> > <br>> > <br>> > Map.addPopup(popup);<br>> > <br>> > } <br>> > <br>> > },<br>> > <br>> > <br>> > <br>> > onMove: function(evt) {<br>> > <br>> > if (popup != null) {<br>> > <br>> > popup.destroy();<br>> > <br>> > popup = null;<br>> > <br>> > }<br>> > <br>> > <br>> > <br>> > // if this control sent an Ajax request (e.g. <br>> > GetFeatureInfo) when<br>> > <br>> > // the mouse pauses the onMove callback could be <br>> > used to abort that<br>> > <br>> > // request.<br>> > <br>> > }<br>> > <br>> > });<br>> > <br>> > <br>> > <br>> > hover = new OpenLayers.Control.Hover(); <br>> > <br>> > Map.addControl(hover);<br>> > <br>> > hover.activate();<br>> > <br>> > <br>> > <br>> > <br>> > <br>> > <br>> > <br>> > *From:* FRANZ OKYERE [mailto:franzzoa@hotmail.com]<br>> > *Sent:* Wednesday, June 02, 2010 4:28 PM<br>> > *To:* Geomooselist<br>> > *Subject:* Re: [Geomoose-users] Mouseover map area to show pop up or <br>> > link<br>> > <br>> > <br>> > <br>> > Thanks,<br>> > <br>> > <br>> > <br>> > But is geomoose not based on open layers? If it is then what we can do <br>> > in open layers should be possible in geomoose, right? I really need to <br>> > do this so if you can point me in the right direction and show me <br>> > which of the javascript files I should be editing that would be nice.<br>> > <br>> > <br>> > <br>> > Franz<br>> > <br>> > ----------------------------------------------------------------------<br>> > --<br>> > <br>> > Date: Wed, 2 Jun 2010 14:29:24 -0500<br>> > From: Bob.Basques@ci.stpaul.mn.us <mailto:Bob.Basques@ci.stpaul.mn.us><br>> > To: bfraser@geoanalytic.com <mailto:bfraser@geoanalytic.com>; <br>> > franzzoa@hotmail.com <mailto:franzzoa@hotmail.com><br>> > CC: geomoose-users@lists.sourceforge.net<br>> > <mailto:geomoose-users@lists.sourceforge.net><br>> > Subject: Re: [Geomoose-users] Mouseover map area to show pop up or <br>> > link<br>> > <br>> > All,<br>> > <br>> > <br>> > <br>> > Not on the feature(s), but the layer name/metadata icon in the side menu.<br>> > <br>> > <br>> > <br>> > bobb<br>> > <br>> > <br>> > <br>> > <br>> > <br>> >> >> Brent Fraser <bfraser@geoanalytic.com<br>> > <mailto:bfraser@geoanalytic.com>> wrote:<br>> > <br>> > You mean by simply moving the cursor over the feature but not clicking it?<br>> > Geomoose no (as far as I know). OpenLayers has a hover handler so we <br>> > might be able to use that...<br>> > <br>> > Brent Fraser<br>> > <br>> > FRANZ OKYERE wrote:<br>> >> Hello all,<br>> >><br>> >> I am using geomoose 2.2 and wish to do what google maps or bing maps <br>> >> are able to do- i.e. mouseover a location on the map and then get <br>> >> the popup showing up. Any ideas? Is such a thing possible at all in geomoose?<br>> >><br>> >> Cheers.<br>> >><br>> >> Franz<br>> >><br>> >> GIS Specialist, Ghana.<br>> >><br>> >> <br>> >> ---------------------------------------------------------------------<br>> >> --- Get a free e-mail account with Hotmail. Sign-up now.<br>> >><br>> >><br>> >> <br>> >> ---------------------------------------------------------------------<br>> >> ---<br>> >><br>> >> <br>> > ----------------------------------------------------------------------<br>> > --------<br>> >><br>> >><br>> >><br>> >> <br>> >> ---------------------------------------------------------------------<br>> >> ---<br>> >><br>> >> _______________________________________________<br>> >> Geomoose-users mailing list<br>> >> Geomoose-users@lists.sourceforge.net<br>> > <mailto:Geomoose-users@lists.sourceforge.net><br>> >> https://lists.sourceforge.net/lists/listinfo/geomoose-users<br>> > <br>> > <br>> > ----------------------------------------------------------------------<br>> > -------- ThinkGeek and WIRED's GeekDad team up for the Ultimate <br>> > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental <br>> > unit. See the prize list and enter to win:<br>> > http://p.sf.net/sfu/thinkgeek-promo<br>> > _______________________________________________<br>> > Geomoose-users mailing list<br>> > Geomoose-users@lists.sourceforge.net<br>> > <mailto:Geomoose-users@lists.sourceforge.net><br>> > https://lists.sourceforge.net/lists/listinfo/geomoose-users<br>> > <br>> > <br>> > <br>> > ----------------------------------------------------------------------<br>> > --<br>> > <br>> > Get a new e-mail account with Hotmail - Free. Sign-up now. <br>> > <http://clk.atdmt.com/UKM/go/197222280/direct/01/><br>> > <br>> > <br>> > ----------------------------------------------------------------------<br>> > --<br>> > <br>> > ----------------------------------------------------------------------<br>> > -------- ThinkGeek and WIRED's GeekDad team up for the Ultimate <br>> > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental <br>> > unit. See the prize list and enter to win:<br>> > http://p.sf.net/sfu/thinkgeek-promo<br>> > <br>> > <br>> > ----------------------------------------------------------------------<br>> > --<br>> > <br>> > _______________________________________________<br>> > Geomoose-users mailing list<br>> > Geomoose-users@lists.sourceforge.net<br>> > https://lists.sourceforge.net/lists/listinfo/geomoose-users<br>> <br>> <br>> ------------------------------------------------------------------------------<br>> ThinkGeek and WIRED's GeekDad team up for the Ultimate <br>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the <br>> lucky parental unit. See the prize list and enter to win: <br>> http://p.sf.net/sfu/thinkgeek-promo<br>> _______________________________________________<br>> Geomoose-users mailing list<br>> Geomoose-users@lists.sourceforge.net<br>> https://lists.sourceforge.net/lists/listinfo/geomoose-users<br></div>                                            <br /><hr />Get a new e-mail account with Hotmail - Free. <a href='http://clk.atdmt.com/UKM/go/197222280/direct/01/' target='_new'>Sign-up now.</a></body>
</html>