WebGIS Discussions

Need a push in the right direction when configuring WebMap, Portal or SDI services? Looking for hints and tips, or just looking for Ideas and information? The WebGIS discussion board is where you start those discussions, connect and share information.
Showing results for 
Search instead for 
Do you mean 
Reply
Occasional Contributor
Posts: 12
Registered: ‎08-23-2016
Accepted Solution

Capture Map Click Event : Geospatial Portal SDK 2015 EP05

Hi,

 

In Geospatial Portal SDK 2015 EP05, is there a way to register a MapClick event ?

The Map Move exists but apparently not the MapClick.

 

Many thanks,

 

David

Occasional Contributor
Posts: 12
Registered: ‎08-23-2016

Re: Capture Map Click Event : Geospatial Portal SDK 2015 EP05

Ok,

 

I get the solution : 

$(".map").click(function (e) {
        var coords = $GP.utils.getInMapCrs({
                x: e.offsetX,
                y: e.offsetY
            }),
            msg = "Coords + " + coords.x + ", " + coords.y;
        $GP.ui.info(msg);
        // unregister click event
        $(".map").off("click");
});

But I didn't found it in the documentation.

The $(".map") has a lot of functions to listen event to the map.

 

Enjoy !

 

David