Comments (2)
I am pretty sure this has to do with the ArcGIS API for JavaScript, and not anything to do with TS, Angular, or this lib. The jsfiddle points to a working example with v3.x, but you're writing and using v4.x of the ArcGIS API for JavaScript. Mouse interaction listeners are quite different in this version.
The error I think is because there are only 2 (documented) events you can listen to from the GraphicsLayer
.
I suggest you listen for a click on the MapView
in v4.x.
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#event:click
from angular-esri-loader.
@LudoFont adding onto Jacob's comments, I'd also recommend using the hitTest()
pattern to check for graphics in a GraphicsLayer
or FeatureLayer
. Here's a sample: https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/index.html
// Get the screen point from the view's click event
view.on("click", function(event){
var screenPoint = {
x: event.x,
y: event.y
};
// Search for graphics at the clicked location
view.hitTest(screenPoint).then(function(response){
if(response.results[0].graphic){
console.log("Top graphic found! Here it is: ", response.results[0].graphic);
}
});
})
from angular-esri-loader.
Related Issues (20)
- Question: GIS centered application HOT 1
- The naming problem HOT 1
- Add Angular dependencies to `peerDependencies` HOT 3
- Allow Angular 2 or 4 HOT 3
- Having 2 package.json files and publishing from dist ain't all its cracked up to be HOT 5
- Unmet peer dependency HOT 1
- About Observable.fromEvent(this.mapView,"click") HOT 2
- Question - getting error with angular2-esri-loader with when trying to use js.arcgis.com/3.20/ HOT 2
- Question - Suggestions about implementing point clustering HOT 7
- [Cannot read property 'setTransform' of undefined] in angular cli project HOT 1
- Cannot pan map in IE11 HOT 1
- Multiple components angular 2 + esri 3 + loader HOT 3
- Misaligned tiles with Angular4 HOT 2
- Question: add point to a map HOT 1
- angular2-esri-loader using Angular v2 error spears HOT 3
- Override ArcGIS JS API classes HOT 4
- Angular 5 is live HOT 1
- Where do we go from here? HOT 10
- Unload the loaded JS objects? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-esri-loader.