Maptips on Mapserver

12 messages Options
Embed this post
Permalink
Marc Pfister

Maptips on Mapserver

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Has anyone implemented maptip-like functionality for Mapserver instead of MapGuide? It seems like you could switch Fusion to using the generic selection tool instead of the MG specific one.

 

n
Marc Pfister
Geospatial Data Manager
ENPLAN
[hidden email]
530/221-0440 x108
530/221-6963 Fax

 


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Paul Deschamps

Re: Maptips on Mapserver

Reply Threaded More More options
Print post
Permalink
To my knowledge no.. but you are correct it would be quite simple to develop one using the select widget
All that is needed is to have some logic to detect mouse movement and when the mouse is still have it fire a query.
and output the results.

Cheers

Paul D.


On Tue, Aug 26, 2008 at 2:36 PM, Marc Pfister <[hidden email]> wrote:

Has anyone implemented maptip-like functionality for Mapserver instead of MapGuide? It seems like you could switch Fusion to using the generic selection tool instead of the MG specific one.

 

n
Marc Pfister
Geospatial Data Manager
ENPLAN
[hidden email]
530/221-0440 x108
530/221-6963 Fax

 


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users



_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Marc Pfister

RE: Maptips on Mapserver

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

It’s easy to just take the current maptip code which handles the mouse movement detection and modify it to fire off a Map.Query instead of the MG one. However, when you do this every time you stop moving the mouse you trigger a redraw to show the selection highlighted.

 

So where exactly is the query code? I think I’ll just tweak that that to pass the query back to the maptip code.

 

Also, speaking of queries – is there  a way to change the selection highlight color and lineweight?

 

Marc

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Paul Deschamps
Sent: Tuesday, August 26, 2008 11:46 AM
To: Marc Pfister
Cc: [hidden email]
Subject: Re: [fusion-users] Maptips on Mapserver

 

To my knowledge no.. but you are correct it would be quite simple to develop one using the select widget
All that is needed is to have some logic to detect mouse movement and when the mouse is still have it fire a query.
and output the results.

Cheers

Paul D.

On Tue, Aug 26, 2008 at 2:36 PM, Marc Pfister <[hidden email]> wrote:

Has anyone implemented maptip-like functionality for Mapserver instead of MapGuide? It seems like you could switch Fusion to using the generic selection tool instead of the MG specific one.

 

n
Marc Pfister
Geospatial Data Manager
ENPLAN
[hidden email]
530/221-0440 x108
530/221-6963 Fax

 


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users

 


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Paul Deschamps

Re: Maptips on Mapserver

Reply Threaded More More options
Print post
Permalink
The mapserver highlight is part of the query block

http://mapserver.gis.umn.edu/docs/reference/mapfile/querymap

Have a look at the SelectionPannel widget it has a complete Query/Select->DisplayResults Process for mapserver.

Cheers

Paul.


On Tue, Aug 26, 2008 at 8:04 PM, Marc Pfister <[hidden email]> wrote:

It's easy to just take the current maptip code which handles the mouse movement detection and modify it to fire off a Map.Query instead of the MG one. However, when you do this every time you stop moving the mouse you trigger a redraw to show the selection highlighted.

 

So where exactly is the query code? I think I'll just tweak that that to pass the query back to the maptip code.

 

Also, speaking of queries – is there  a way to change the selection highlight color and lineweight?

 

Marc

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Paul Deschamps
Sent: Tuesday, August 26, 2008 11:46 AM
To: Marc Pfister
Cc: [hidden email]
Subject: Re: [fusion-users] Maptips on Mapserver

 

To my knowledge no.. but you are correct it would be quite simple to develop one using the select widget
All that is needed is to have some logic to detect mouse movement and when the mouse is still have it fire a query.
and output the results.

Cheers

Paul D.

On Tue, Aug 26, 2008 at 2:36 PM, Marc Pfister <[hidden email]> wrote:

Has anyone implemented maptip-like functionality for Mapserver instead of MapGuide? It seems like you could switch Fusion to using the generic selection tool instead of the MG specific one.

 

n
Marc Pfister
Geospatial Data Manager
ENPLAN
[hidden email]
530/221-0440 x108
530/221-6963 Fax

 


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users

 



_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Marc Pfister

RE: Maptips on Mapserver

Reply Threaded More More options
Print post
Permalink
In reply to this post by Marc Pfister
Some javascript/style in this post has been disabled (why?)

 

I have bodged maptips to work with Mapserver and have the code kicking back the string I want to display in the tooltip. However, the code seems like it expects some XML generated by MapGuide. Can someone who runs MapGuide post an example of the XML so I can reproduce it and pass it on to the _display function and keep it all happy?

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Paul Deschamps
Sent: Wednesday, August 27, 2008 6:11 AM
To: Marc Pfister
Subject: Re: [fusion-users] Maptips on Mapserver

 

The mapserver highlight is part of the query block

http://mapserver.gis.umn.edu/docs/reference/mapfile/querymap

Have a look at the SelectionPannel widget it has a complete Query/Select->DisplayResults Process for mapserver.

Cheers

Paul.

On Tue, Aug 26, 2008 at 8:04 PM, Marc Pfister <[hidden email]> wrote:

It's easy to just take the current maptip code which handles the mouse movement detection and modify it to fire off a Map.Query instead of the MG one. However, when you do this every time you stop moving the mouse you trigger a redraw to show the selection highlighted.

 

So where exactly is the query code? I think I'll just tweak that that to pass the query back to the maptip code.

 

Also, speaking of queries – is there  a way to change the selection highlight color and lineweight?

 

Marc

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Paul Deschamps
Sent: Tuesday, August 26, 2008 11:46 AM
To: Marc Pfister
Cc: [hidden email]
Subject: Re: [fusion-users] Maptips on Mapserver

 

To my knowledge no.. but you are correct it would be quite simple to develop one using the select widget
All that is needed is to have some logic to detect mouse movement and when the mouse is still have it fire a query.
and output the results.

Cheers

Paul D.

On Tue, Aug 26, 2008 at 2:36 PM, Marc Pfister <[hidden email]> wrote:

Has anyone implemented maptip-like functionality for Mapserver instead of MapGuide? It seems like you could switch Fusion to using the generic selection tool instead of the MG specific one.

 

n
Marc Pfister
Geospatial Data Manager
ENPLAN
[hidden email]
530/221-0440 x108
530/221-6963 Fax

 


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users

 

 


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Jason Birch

RE: Maptips on Mapserver

Reply Threaded More More options
Print post
Permalink
Hi Marc,
 
The MapGuide QueryMapFeatures call returns a FeatureInformation XML doc.
Here's an example:

<?xml version="1.0" encoding="UTF-8"?>
<FeatureInformation>
 <FeatureSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="FeatureSet-1.0.0.xsd"> <Layer
id="dabba2fe-ffff-ffff-8000-005056b512c0"> <Class id="Default:Parks">
<ID>YAEAAA==</ID> </Class> </Layer></FeatureSet>
 <Tooltip>Goldfinch Park</Tooltip>
 <Hyperlink />
 <Property name="parkName" value="Goldfinch Park" />
 <Property name="parkAddress" value="" />
</FeatureInformation>

Which then gets passed through XML2JSON to give this:

{"FeatureInformation":{"FeatureSet":[{"@noNamespaceSchemaLocation":["Fea
tureSet-1.0.0.xsd"],"Layer":[{"@id":["dabba2fe-ffff-ffff-8000-005056b512
c0"],"Class":[{"@id":["Default:Parks"],"ID":["YAEAAA=="]}]}]}],"Tooltip"
:["Goldfinch
Park"],"Property":[{"@name":["parkName"],"@value":["Goldfinch
Park"]},{"@name":["parkAddress"],"@value":[""]}]}};

I can't find a schema for FeatureInformation, but the schema for one of
its components (FeatureSet) can be found here:
 
http://trac.osgeo.org/mapguide/browser/trunk/MgDev/Common/Schema

There's all kinds of complexity around the feature ID encoding, but I
don't think that's important for a MapServer implementation.

Jason

________________________________

From: Marc Pfister
Subject: RE: [fusion-users] Maptips on Mapserver

I have bodged maptips to work with Mapserver and have the code kicking
back the string I want to display in the tooltip. However, the code
seems like it expects some XML generated by MapGuide. Can someone who
runs MapGuide post an example of the XML so I can reproduce it and pass
it on to the _display function and keep it all happy?
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Marc Pfister

RE: Maptips on Mapserver

Reply Threaded More More options
Print post
Permalink
I have Maptips sort-of working now on Mapserver. Only problem is that
they aren't visible. On FF3 I thought it might be a Z-index thing, like
the measure tool, but I don't see them on IE7 either. Looking at the
HTML source in Firebug though, it certainly looks like it created the
Maptip.

Does this look right? Here's the html:


<li id="FusionItem28" class="maptipContainer" style="display: block;
top: 480px; left: 612px; visibility: visible;">
<div class="maptipContent">
SPMU-CH-CBDZ
<iframe class="maptipShim" scrolling="no" style="width: 1271px; height:
42px;">
<html>
<head>
<title/>
</head>
<body/>
</html>
</iframe>
</div>
</li>

It's in this map if you'd like to take a closer look:

http://209.20.81.81/fusion/templates/mapserver/corning/

The console log will return the value of the maptip and a message that
it set the maptip to "visible'.

Marc



_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Paul Spencer-2

Re: Maptips on Mapserver

Reply Threaded More More options
Print post
Permalink
Marc,

couple of things -

1.  Why is the maptip container an LI element?  That seems odd.  It  
looks actually like you've assigned your MapTip widget to something in  
a toolbar?  You should not put it in a toolbar, but rather add an  
extra div to your page.

<div id="maptipContainer"></div>

2. You need to add the z-index on this container object:

#maptipContainer {
   position: absolute;
   z-index: 101
}

3. Starting with ffox 3 you need to assign z-indexes to other things  
that are parallel to the maptip container, in this case the div with  
the id 'thePage':

#thePage {
   zindex: 1
}

should do the trick.  I think IE is similar in this respect.

Cheers

Paul

On 3-Sep-08, at 7:16 PM, Marc Pfister wrote:

> I have Maptips sort-of working now on Mapserver. Only problem is that
> they aren't visible. On FF3 I thought it might be a Z-index thing,  
> like
> the measure tool, but I don't see them on IE7 either. Looking at the
> HTML source in Firebug though, it certainly looks like it created the
> Maptip.
>
> Does this look right? Here's the html:
>
>
> <li id="FusionItem28" class="maptipContainer" style="display: block;
> top: 480px; left: 612px; visibility: visible;">
> <div class="maptipContent">
> SPMU-CH-CBDZ
> <iframe class="maptipShim" scrolling="no" style="width: 1271px;  
> height:
> 42px;">
> <html>
> <head>
> <title/>
> </head>
> <body/>
> </html>
> </iframe>
> </div>
> </li>
>
> It's in this map if you'd like to take a closer look:
>
> http://209.20.81.81/fusion/templates/mapserver/corning/
>
> The console log will return the value of the maptip and a message that
> it set the maptip to "visible'.
>
> Marc
>
>
>
> _______________________________________________
> fusion-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fusion-users


__________________________________________

    Paul Spencer
    Chief Technology Officer
    DM Solutions Group Inc
    http://www.dmsolutions.ca/

_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Marc Pfister

RE: Maptips on Mapserver

Reply Threaded More More options
Print post
Permalink
Paul Spencer [mailto:[hidden email]] wrote:

> 1.  Why is the maptip container an LI element?  That seems odd.  It
> looks actually like you've assigned your MapTip widget to something in
> a toolbar?  You should not put it in a toolbar, but rather add an
> extra div to your page.
>
> <div id="maptipContainer"></div>

Hmm, for some reason I added the Widget to the end of one of the toolbar
containers in ApplicationDefinition.XML, so no wonder it was doing that.

 
So that then leads to the question, what exactly is the right way to use
maptip in ApplicationDefinition.XML?

I've got the widget added:

<Widget xsi:type="WidgetType">
<Name>Maptip</Name>
<Type>Maptip</Type>
<StatusItem/>
</Widget>

But now though Maptip.js loads, it never initializes. It was
initializing when I had the Maptip as an item in the toolbar container,
so do I need some sort of container for the maptip that corresponds to
the maptipContainer div?

Marc
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Mike Adair

Re: Maptips on Mapserver

Reply Threaded More More options
Print post
Permalink
That should be all you need, as long as the <Name> element for MapTip
widget in AppDef MapTip matches the ID of the div in your template.

Mike

Marc Pfister wrote:

> Paul Spencer [mailto:[hidden email]] wrote:
>
>  
>> 1.  Why is the maptip container an LI element?  That seems odd.  It
>> looks actually like you've assigned your MapTip widget to something in
>> a toolbar?  You should not put it in a toolbar, but rather add an
>> extra div to your page.
>>
>> <div id="maptipContainer"></div>
>>    
>
> Hmm, for some reason I added the Widget to the end of one of the toolbar
> containers in ApplicationDefinition.XML, so no wonder it was doing that.
>
>  
> So that then leads to the question, what exactly is the right way to use
> maptip in ApplicationDefinition.XML?
>
> I've got the widget added:
>
> <Widget xsi:type="WidgetType">
> <Name>Maptip</Name>
> <Type>Maptip</Type>
> <StatusItem/>
> </Widget>
>
> But now though Maptip.js loads, it never initializes. It was
> initializing when I had the Maptip as an item in the toolbar container,
> so do I need some sort of container for the maptip that corresponds to
> the maptipContainer div?
>
> Marc
> _______________________________________________
> fusion-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
>  
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Nolte, Tim

RE: Maptips on Mapserver

Reply Threaded More More options
Print post
Permalink
In reply to this post by Marc Pfister
Marc,

Here is the spec on the Maptip widget:
        http://trac.osgeo.org/fusion/wiki/Widgets/Maptip

Also, for an example of the Maptip Widget in the
ApplicationDefinition.XML look at the one included in
'fusion\templates\mapguide\standard'.

BTW, I'm very interested in your solution on this. :-)

- Tim

----
Timothy J Nolte - [hidden email]
Network Planning Engineer

iPCS Wireless, Inc.
4717 Broadmoor Ave, Suite G
Kentwood, MI 49512

Office: 616-656-5163
PCS:    616-706-2438
Fax:    616-554-6484
Web: www.ipcswirelessinc.com
-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Marc Pfister
Sent: Thursday, September 04, 2008 2:12 PM
To: Paul Spencer
Cc: [hidden email]
Subject: RE: [fusion-users] Maptips on Mapserver

Paul Spencer [mailto:[hidden email]] wrote:

> 1.  Why is the maptip container an LI element?  That seems odd.  It
> looks actually like you've assigned your MapTip widget to something in
> a toolbar?  You should not put it in a toolbar, but rather add an
> extra div to your page.
>
> <div id="maptipContainer"></div>

Hmm, for some reason I added the Widget to the end of one of the toolbar
containers in ApplicationDefinition.XML, so no wonder it was doing that.

 
So that then leads to the question, what exactly is the right way to use
maptip in ApplicationDefinition.XML?

I've got the widget added:

<Widget xsi:type="WidgetType">
<Name>Maptip</Name>
<Type>Maptip</Type>
<StatusItem/>
</Widget>

But now though Maptip.js loads, it never initializes. It was
initializing when I had the Maptip as an item in the toolbar container,
so do I need some sort of container for the maptip that corresponds to
the maptipContainer div?

Marc
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users

_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Marc Pfister

RE: Maptips on Mapserver

Reply Threaded More More options
Print post
Permalink
In reply to this post by Mike Adair
Mike Adair [mailto:[hidden email]] wrote:

> That should be all you need, as long as the <Name> element for MapTip
> widget in AppDef MapTip matches the ID of the div in your template.

Which it doesn't. Or should I say didn't. Slowly this is all making
sense.

I present to you maptips on Mapserver:

http://209.20.81.81/fusion/templates/mapserver/corning/

The code is currently ugly and useless for the general public, but now
that at least this works I will fix that. I'll set it up to pass some
Mapserver-specific parameter for the fields to use for the maptip text
and hyperlink instead of hardcoded values.

Can someone point to what I need to know about checking code out and
back in. I've always been a passive user of SVN and the like but now it
seems I'm going to need to learn more.

Also, should this be on Fusion-Dev or Fusion-Users?

Marc
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users