Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [event-listener]

In computing an event is an action that is usually initiated outside the scope of a program and that is handled by a piece of code inside the program

0
votes
0answers
29 views

How to listen to touch events on Leaflet GeoJSON linestrings?

I'm using react-leaflet to display a map with GeoJSON linestrings and points. My mouseOver, mouseOut, and click events work fine with a mouse. However, I can't get the tap or touch events to work on ...
1
vote
0answers
59 views

Difference between an interaction and eventListener in OpenLayers

I am wondering when should I use an interaction instead of an eventListener. For example I can have a handler function like this: function handler(evt) { if (evt.type === 'click') { console....
2
votes
0answers
436 views

Listen to a click event inside bindpopup with Leaflet

I'm using Leaflet, I have bound popups to layers, and created a popupopen event listener on the map as follow: map.on('popupopen', this._managePopUp.bind(this)); _managePopUp(layer) { ...
1
vote
1answer
16 views

How do you retrieve a single attribute from a feature layer by clicking on it using ArcGIS Javascript API v3.2?

I am building a map that you can hover over and click on. I need to access a feature's project number (ProjectNum) when I click on it, but my click event on the layer doesn't seem to be firing. When I ...
0
votes
1answer
46 views

List of possible events from event handler

This may be an elementary question but I cannot figure out how to word it so that I can google it properly. map.on('click', function(evt) { var coordinates = evt.coordinate; alert(coordinates)...
1
vote
2answers
440 views

OpenLayers 4 hover popup delay

I added a function to display a popup on hover to the feature layer but it doesn't work very well. Here my code: map.on('pointermove', function(evt) { if (evt.dragging) { return; } var ...
0
votes
1answer
268 views

OpenLayers 2 loadstart and loadend

I want to add a loading symbol to my openlayers map, which is triggered when a layer is set to load and stopped when the layer is loaded. So I used the event listeners loadstart and loaded. Here is my ...
0
votes
1answer
323 views

Calling a function after map display rather than map load

I have the following method which I am calling on load of the map. However when I try to turn on a particular layer within this code I am unsuccessful as although the map would have been loaded it ...
0
votes
1answer
295 views

How to determine whether a map click event has been set?

The Evented section of the Leaflet documentation shows how to set an event listener for the map object: Leaflet deals with event listeners by reference, so if you want to add a listener and then ...
3
votes
3answers
130 views

Clear Points and Replot a new one

Is it possible to reset or clear the map and plot new points? I have a search box that am using to query a geojson API. After the first mapped result, the second search is plotted in addition which ...
1
vote
1answer
184 views

Displaying results through polygon tool on Leaflet map using event listeners

I have certain documents residing on within my database. Currently i am able to display their Geojson on the map by drawing a polyogon within a certain area and then clicking on a button but i want to ...
3
votes
1answer
427 views

How to detect when new markers have been added to the leaflet map?

May i ask how to I add a event listener to the map to detect when a marker has been added to the map? In the docs, it says that we can use the "add" event, but how do I actually use it? http://...
1
vote
0answers
734 views

An OL3 listener seems undefined as reported by ol-debug.js [closed]

I am using ol3/3.15.1/ol-debug.js, and get the error message in the console: ol-debug.js:6326 Uncaught TypeError: Cannot read property 'call' of undefined at ol.source.Vector.ol.events....
2
votes
1answer
589 views

Cannot catch click event on FeatureLayer in ArcGIS API for JavaScript 4?

I've got a SceneView with a FeatureLayer, and I'm trying to catch every click on a PictureMarkerSymbol to display additional data under the map. The map works well, so do symbols and popups, but I ...
3
votes
2answers
1k views

Watching for scale/zoom changes in ArcGIS API for JavaScript 4?

I am trying to add an event listener for when the scale of the map changes, that is scale or zoom level changes in order to enable or disable feature layer label text. When the user zooms in to a ...
1
vote
0answers
227 views

How to bind the 'mouseover' event in a leaflet-routing route?

I'm trying to mimic the GoogleMaps behavior of creating a small white circular marker on a route when you hover on the route. My idea is to listen for the 'mouseover' event (if there is any) and then ...
2
votes
1answer
2k views

Getting multiple functions to work with mouseover event in Leaflet

I am making a web mapping app using leaflet and some geoJSON data for a grid. I want to be able to mouseover each grid cell and both highlight that cell AND show a popup of the coordinates. In the ...
0
votes
1answer
64 views

Multiple Selection with OL2

I created a map with some marker which can be selected and have them name appears in an external field. But i even if i am able to select multiple marker on the map ( shift command ), only one name ...
1
vote
1answer
515 views

Multiple Selection

I implemented a map with markers pointing to airports, and when I click on a marker the name of the airport appears in a field. (All date included in a GEOJson external file). I just have a last ...
1
vote
0answers
174 views

OpenLayers 3, map.on('moveend',..): Differentiate between user interaction and map.setCenter() calling

I am implementing OpenLayers for a GIS application and want to add a 20 seconds timeout when the user scrolled the map, after which the GPS auto track function should resume. For that I am utilizing ...
1
vote
1answer
3k views

why can't I load a layers list to select from to the map in openLayers 3, addEventListener and attachEvent are unavailable

I've tried to incorporate this sample that shows how to switch base layers into a page I am working on: http://openlayers.org/en/v3.10.1/examples/bing-maps.html When I try to load my page with the ...