I think a more common approach is to get your point data via a WFS call as GeoJSON and then draw it using javascript in the client. Using your .svg as a marker, LeafletJS, OpenLayers, just about anything will draw the marker, make only the footprint clickable and it scales at all levels.

If your data doesn't update, say, more than hourly, and you really want to simplify production, save your point data (or any vector data) as FlatGeobuf. Nothing more than a simple web server to host the .fgb file(s) is required (sorry MapServer!). Also, your masterportal.js is over 8MB, that's a lot of JS for the client to download.

I use the above approach with 10's of millions addresses and building footprints. The clickable area exactly matches any building footprint (polygon):
https://www.femafhz.com/map/33.823316/-117.919366/18/footprints,addresses?vw=0

Scott

On 11/15/24 14:36, Lime, Steve D (MNIT) via MapServer-users wrote:
Hi Lars: Hmmm… I see what you mean but I can’t think of anything easy offhand. We’d almost want a TOLERANCE MARKER option where you’d create dynamic features from the placed markers first and then query those instead of the underlying points. Or perhaps allow tolerance to be defined with a dx/dy or even a simple polygon in the case where a layer is a point feature.

If you’re using PostGIS, I wonder if you could create a query-only polygon layer from the point layer. That is, basically create a rectangle from the point based on the map extent, size or scale and then you query that instead – same attributes and everything working off a derived geometry.

--Steve

*From:*MapServer-users <mapserver-users-boun...@lists.osgeo.org> *On Behalf Of *Lars Baum via MapServer-users
*Sent:* Friday, November 15, 2024 3:52 AM
*To:* mapserver-users@lists.osgeo.org
*Subject:* [MapServer-users] Custom Click Tolerance Shape for GFI Requests

Dear MapServer Community,

we have faced an issue with the click tolerance for WMS GetFeatureInfo requests when using custom map symbols. We use a custom .svg vector image to display points in most of our maps. As I understand it, the TOLERANCE parameter only defines a radius around the point. Therefore the shape of the clickable area is always a circle. This does not match our symbol at all and results in a bad user experience. Essentially, only the very tip of the image is actually clickable.

I have created a demo page for demonstration purposes. Please visit https://koelngis.stadt-koeln.de/koelngis/portale/ mapServerClickTolerance/ <https://koelngis.stadt-koeln.de/koelngis/ portale/mapServerClickTolerance/> to experience this problem yourself.

  * The layer with orange symbols is a WMS layer that demonstrates the
    problem I described above. It is terrible to work with since most
    users instinctively click on the white circle but actually have to
    click the tip to get a GFI response. I have added an additional
    point layer that shows the clickable area defined by the TOLERANCE
    setting.

  * The layer with blue symbols is a WFS layer that works perfectly fine
    (since the click is handled client-side). This is the desired
    behavior for WMS requests as well. We cannot always use WFS due to
    client performance constraints.

We would like to configure the MapServer so that the entire shape can be clicked precisely. However, we could not find this capability in the documentation. Please let us know if it is possible. Offsetting the symbol so that the white circle matches the clickable point is not an option because then the tip would indicate that the feature is at a different location.

If it is in fact not possible and any commercial service providers are reading this mailing list:

Feel free to send me a quote to opensource-mapser...@larsbaum.slmail.me <mailto:opensource-mapser...@larsbaum.slmail.me>. We would like to pay someone to contribute this functionality for .svg vector images to the MapServer open source project.

For reference, this is how we configure the symbol in the mapfile:

             SYMBOL

                         NAME "droplet"

                         TYPE SVG

                        IMAGE "../svg/dropletShape.svg" # You can grab a similar .svg file from the website linked above.

                        ANCHORPOINT 0.5 1 # Make sure the tip of the shape is centered on the point

             END

# …

             TOLERANCEUNITS pixels

             TOLERANCE 10 # Radius of the clickable circle around the point

CLASS

                         NAME "Some Name"

                         STYLE

                                     SYMBOL "droplet"

                                     SIZE 40

                         END

             END

Thank you very much for your help!

Yours sincerely

Lars Baum
GIS Developer

City of Cologne - The Lord Mayor

Office for Information Processing
Competence Center Geoinformationsystems

Auf dem Hunnenrücken 3
50668 Cologne, Germany

Mail: opensource-mapser...@larsbaum.slmail.me <mailto:opensource- mapser...@larsbaum.slmail.me>
Note: I'm using an alias mail to protect my business mail account from spam.


_______________________________________________
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to