[Geomoose-users] Mouseover map area to show pop up or link
Brent Fraser
bfraser at geoanalytic.com
Thu Jun 3 11:45:16 EDT 2010
Should we add Len's code to standard GeoMoose? And expose it via something like:
<layer-controls>
<layer-control name="popups" service-name="popups" layer-input="layer"
on="true" tip="Show Popups for %LAYER%"/>
<layer-control name="maptips" service-name="maptips" layer-input="layer"
on="true" tip="Show MapTips for %LAYER%"/>
</layer-controls>
<service name="maptips" display="true">
<url>php/popups.php</url>
<step type="spatial" name="shape" line="false" polygon="false" point="false"
jump-start="true" default="hover">
<header><![CDATA[
Hover on the map to show a tip about the features.
]]></header>
<input type="hidden" name="layer"/>
</step>
</service>
or something like that....
Brent
FRANZ OKYERE wrote:
> Thanks guys,
>
> I am going see how I can implement Len's solution in my current
> installation. I am going to try both options and see how it works. Len
> also gave this link earlier on
> :http://www.klamathdss.org/watershedviewer/# as an example of the
> identify tool being used with a popup. Any surprises, and I will get
> back and get some help. Thanks.
>
> Franz
>
> GIS Specialist
>
> Ghana
>
> ------------------------------------------------------------------------
> From: lkne at houstoneng.com
> To: franzzoa at hotmail.com; geomoose-users at lists.sourceforge.net
> Subject: RE: [Geomoose-users] Mouseover map area to show pop up or link
> Date: Thu, 3 Jun 2010 14:06:11 +0000
>
> One way would be to use OL Hover handler – see
> http://openlayers.org/dev/examples/hover-handler.html. Basically it is
> going to make an ajax call to the identify service when the cursor
> hovers over a spot for a set time. The script below works in my testing
> environment… it could be enabled as a tool or in onLoadedMapbook().
>
>
>
> Len
>
>
>
> // Hover support on WMS and MapServr layers
>
> var popup;
>
> OpenLayers.Control.Hover =
> OpenLayers.Class(OpenLayers.Control, {
>
> defaultHandlerOptions: {
>
> 'delay': 500,
>
> 'pixelTolerance': 20,
>
> 'stopMove': false
>
> },
>
>
>
> initialize: function(options) {
>
> this.handlerOptions = OpenLayers.Util.extend(
>
> {}, this.defaultHandlerOptions
>
> );
>
> OpenLayers.Control.prototype.initialize.apply(
>
> this, arguments
>
> );
>
> this.handler = new OpenLayers.Handler.Hover(
>
> this,
>
> {'pause': this.onPause, 'move': this.onMove},
>
> this.handlerOptions
>
> );
>
> },
>
>
>
> onPause: function(evt) {
>
> var feature =
> Map.getLonLatFromPixel(evt.xy);
>
> var url =
> '/php/identify.php?';
>
> var layersArray =
> GeoMOOSE.getVisibleLayers();
>
> layers =
> layersArray.join(':');
>
> var requestOptions =
> OpenLayers.Request.GET({
>
> url: url,
>
> params:
> {'shape': 'POINT(' + feature.lon + ' ' + feature.lat + ')',
>
>
> 'layers': layers,
>
>
> '_moosetime': (new Date()).getTime() },
>
> async: false
>
> });
>
>
>
>
> if(requestOptions.responseText) {
>
> popup =
> new OpenLayers.Popup.FramedCloud("wms",
>
>
> Map.getLonLatFromPixel(evt.xy),
>
>
> null,
>
>
> requestOptions.responseText,
>
>
> null, false);
>
>
> Map.addPopup(popup);
>
> }
>
> },
>
>
>
> onMove: function(evt) {
>
> if (popup != null) {
>
> popup.destroy();
>
> popup = null;
>
> }
>
>
>
> // if this control sent an Ajax request (e.g.
> GetFeatureInfo) when
>
> // the mouse pauses the onMove callback could be
> used to abort that
>
> // request.
>
> }
>
> });
>
>
>
> hover = new OpenLayers.Control.Hover();
>
> Map.addControl(hover);
>
> hover.activate();
>
>
>
>
>
>
>
> *From:* FRANZ OKYERE [mailto:franzzoa at hotmail.com]
> *Sent:* Wednesday, June 02, 2010 4:28 PM
> *To:* Geomooselist
> *Subject:* Re: [Geomoose-users] Mouseover map area to show pop up or link
>
>
>
> Thanks,
>
>
>
> But is geomoose not based on open layers? If it is then what we can do
> in open layers should be possible in geomoose, right? I really need to
> do this so if you can point me in the right direction and show me which
> of the javascript files I should be editing that would be nice.
>
>
>
> Franz
>
> ------------------------------------------------------------------------
>
> Date: Wed, 2 Jun 2010 14:29:24 -0500
> From: Bob.Basques at ci.stpaul.mn.us <mailto:Bob.Basques at ci.stpaul.mn.us>
> To: bfraser at geoanalytic.com <mailto:bfraser at geoanalytic.com>;
> franzzoa at hotmail.com <mailto:franzzoa at hotmail.com>
> CC: geomoose-users at lists.sourceforge.net
> <mailto:geomoose-users at lists.sourceforge.net>
> Subject: Re: [Geomoose-users] Mouseover map area to show pop up or link
>
> All,
>
>
>
> Not on the feature(s), but the layer name/metadata icon in the side menu.
>
>
>
> bobb
>
>
>
>
>
>> >> Brent Fraser <bfraser at geoanalytic.com
> <mailto:bfraser at geoanalytic.com>> wrote:
>
> You mean by simply moving the cursor over the feature but not clicking it?
> Geomoose no (as far as I know). OpenLayers has a hover handler so we
> might be
> able to use that...
>
> Brent Fraser
>
> FRANZ OKYERE wrote:
>> Hello all,
>>
>> I am using geomoose 2.2 and wish to do what google maps or bing maps are
>> able to do- i.e. mouseover a location on the map and then get the popup
>> showing up. Any ideas? Is such a thing possible at all in geomoose?
>>
>> Cheers.
>>
>> Franz
>>
>> GIS Specialist, Ghana.
>>
>> ------------------------------------------------------------------------
>> Get a free e-mail account with Hotmail. Sign-up now.
>>
>>
>> ------------------------------------------------------------------------
>>
>>
> ------------------------------------------------------------------------------
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Geomoose-users mailing list
>> Geomoose-users at lists.sourceforge.net
> <mailto:Geomoose-users at lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/geomoose-users
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.sourceforge.net
> <mailto:Geomoose-users at lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/geomoose-users
>
>
>
> ------------------------------------------------------------------------
>
> Get a new e-mail account with Hotmail - Free. Sign-up now.
> <http://clk.atdmt.com/UKM/go/197222280/direct/01/>
>
>
> ------------------------------------------------------------------------
> Get a new e-mail account with Hotmail – Free. Sign-up now.
> <http://clk.atdmt.com/UKM/go/197222280/direct/01/>
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geomoose-users
More information about the Geomoose-users
mailing list