Hi - I'm working with Javascript maps SDK 4.32 and am attempting to add a feature layer to a map component. I'm basing my effort on the map component angular sample on github (https://github.com/Esri/jsapi-resources/tree/main/component-samples/map-components/samples/angular) and this post about adding a feature layer to a map component (https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-component-api/td-p/1418711)
Below is the code I'm using. I'm getting an error 'addLayer does not exist on type element'
html:
<arcgis-map item-id="d5dda743788a4b0688fe48f43ae7beb9" (arcgisViewReadyChange)="arcgisViewReadyChange($event)"></arcgis-map>
component:
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import "@arcgis/map-components/components/arcgis-map";
import FeatureLayer from '@arcgis/core/layers/FeatureLayer';
Solved! Go to Solution.
Here is a sample Angular app that adds a layer and more. You don't instantiate components, just declare them via html elements.
https://github.com/odoe/map-components-angular/blob/main/src/app/components/map/map.component.ts
I've made a little progress. I can see the arcgis-map component properties from the event.target (see attached console screen shot)
Here is a sample Angular app that adds a layer and more. You don't instantiate components, just declare them via html elements.
https://github.com/odoe/map-components-angular/blob/main/src/app/components/map/map.component.ts
Thanks Rene - got the feature layer added.
Pete
Got the error: TS2304: cannot find name 'WeakRef' solved by adding adding ESNext to tsconfig.json