MapView is undefined in Angular component
See original GitHub issueHi,
I am using MapView in angular template. I have followed all steps as mentioned in the main page of the repository:
registerElement("MapView", () => MapView);
- Added
@ViewChild("MapView") mapView: MapView
to the properties of angular component class - Added it to component template
<GridLayout> <MapView (mapReady)="onMapReady($event)"></MapView> </GridLayout>
The map displays and active. But i can’t add markers and other stuff to the map because my this.mapView property is undefined.
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Angular property showing as undefined [closed] - Stack Overflow
It seems that the data is loaded via a service but when we try to access the specific properties in a loop, it...
Read more >Cannot read property 'setTransform' of undefined
I try to develop arcgis api application with angular-esri-components solution. I get 「Cannot read property 'setTransform' of undefined」 ...
Read more >MapView | API Reference | ArcGIS Maps SDK for JavaScript ...
For a map to be visible to the user in the DOM, a MapView must be created and reference a minimum of two...
Read more >React Google Maps Api Style Guide
The two basic components required to load a simple map are: LoadScript - Loads the Google Maps API script ... preventGoogleFontsLoading, boolean |...
Read more >Introduction to React Native Maps - LogRocket Blog
If the value of the current property is undefined , that means the component is not yet mounted. Now, you can access any...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use like this:
Yea, the method described in the doc didn’t work for me. Instead, in on the
onMapReady()
function do this…And replace
@ViewChild("MapView") mapView: MapView;
withprivate mapView: MapView;
You should be all set then.