[Geomoose-users] Mouseover map area to show pop up or link

FRANZ OKYERE franzzoa at hotmail.com
Tue Jun 22 16:06:51 EDT 2010


Nayate,

 

I think (I have not tried it out) you first need to go to the mapbook and change the following line

 

<tool name="identify" title="Identify" type="service" service="identify" cursor="url('cursors/identify2.cur'),auto"/>

 

to

 

<tool name="identify" title="Identify" type="javascript" selectable="true">
   GeoMOOSE.popIdentify(arguments);
  </tool>


 

Then in compiled.js write the popIdentify function such that it is within the window.Geomoose constructor?

 

All the best.

 

Franz

 

GIS Specialist

Ghana

 

 


From: nayna.nayate at gis.leg.mn
To: geomoose-users at lists.sourceforge.net
Date: Tue, 22 Jun 2010 13:20:21 -0500
Subject: Re: [Geomoose-users] Mouseover map area to show pop up or link







I tried this code out in my geomoose application by inserting the code in the onLoadedMapbook() in complied.js and it works well.  
Any hints on how I could be enabled as a tool?  I’m trying to get this functionality activated only when I select the identify tool.
 
 
 


From: Len Kne [mailto:lkne at houstoneng.com] 
Sent: 03 June 2010 09:06
To: 'FRANZ OKYERE'; Geomooselist
Subject: Re: [Geomoose-users] Mouseover map area to show pop up or link
 
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
To: bfraser at geoanalytic.com; franzzoa at hotmail.com
CC: 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> 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
> 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
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/
Do you have a story that started on Hotmail? Tell us now
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20100622/b967c227/attachment.html


More information about the Geomoose-users mailing list