POST
|
Hi - I've got a PopupTemplate associated with a FeatureLayer. I'm hoping to keep it from collapsing content in a mobile screen size. I've seen this solution for a View Popup https://community.esri.com/t5/arcgis-api-for-javascript/popup-functionality-in-mobile-view/td-p/562752 but I don't see a similar collapsed or collapseEnabled property for the PopupTemplate. PopUp also has a features property which accepts an array of graphics that can have a PopupTemplate associated with them, https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features but this doesn't work for a Feature Layer -- at least I don't see how to extract the graphics with attached PopupTemplate from the Feature layer. Any ideas? Thanks Pete
... View more
4 weeks ago
|
0
|
0
|
47
|
POST
|
Hi John - it works ok with pure Javascript. I'm using typescript and angular so I guess this is whats giving me trouble. My code is below. I've based it on the github jsapi-angular-cli example located here: https://github.com/Esri/jsapi-resources initializeMap (): Promise < any > { const map = new Map ({ basemap : 'streets' }); const view = new MapView ({ container : this . viewNode . nativeElement , center : [- 117.5 , 33.9 ], zoom : 10 , map : map }); const graphicsLayer = new GraphicsLayer (); map . add ( graphicsLayer ); //when ticket clicked in ticketlist component--polygon graphic of ticket extent returned here this . TicketGraphicSubscription = this . mapService . TicketGraphicRequest . subscribe (( polygonGraphic : Graphic ) => { let ptGraphic = new Graphic (); ptGraphic = this . mapService . MakeTicketLabelPoint ( polygonGraphic . attributes . Ticket , polygonGraphic . geometry . extent . center ); graphicsLayer . addMany ([ polygonGraphic , ptGraphic ]); view . center = polygonGraphic . geometry . extent . center ; view . zoom = 16 ; console . log ( "view zoomed" ); //map has to be panned or zoomed to see label }); this . view = view ; return this . view . when (); } I also tried taking away the calls to the map service and doing everything within this function but got same results.
... View more
03-09-2021
07:57 AM
|
0
|
0
|
268
|
POST
|
Thanks John, I tried it, but I still need to zoom in or out to get the graphics to display on the map
... View more
03-08-2021
11:52 AM
|
0
|
2
|
286
|
POST
|
Thanks Theo. I've tried adding the code shown for this event in the docs, but the event only seems to fire when the graphicsLayer is initially added to the map map . layers . on ( "after-changes" , function ( event ){ console . log ( event , " layer was added/removed from the map." ); });
... View more
03-08-2021
09:39 AM
|
0
|
0
|
325
|
POST
|
Hi - I'm using version 4.18 of the api and am adding a polygon graphic and a point graphic (text label)l to a map using the addMany method. After adding the graphics I pan to the center of the polygon and set the zoom level to 16. The problem is that the user needs to zoom the map manually for the label to appear. Does anyone know how I can fix this problem? I'm guessing the text label probably hasnt been added to the map yet when the zoom and center occur in my code below Thanks Pete graphicsLayer . addMany ([ polygonGraphic , ptGraphic ]); view . zoom = 16 ; view . center = polygonGraphic . geometry . extent . center ;
... View more
03-08-2021
09:18 AM
|
0
|
6
|
334
|
POST
|
I switched to ES Modules and the code is running fine. Maybe something in my project configuration was causing ESRI loader not to work. Pete
... View more
03-04-2021
10:28 AM
|
0
|
0
|
104
|
POST
|
When I changed the code I get a compile error: "Module not found: Error: Can't resolve 'esri/geometry'"
... View more
03-04-2021
07:10 AM
|
0
|
0
|
112
|
POST
|
Hi I'm using Angular 11, Esri Javascript api 4.18 with the ESRI loader. I'm getting the subject error at runtime when I try to create a new 'esri/geometry/SpatialReference' object. Wierdly, Intellisense recognizes the Spatial Reference Object before I run the code. I'm also able to create the Map and MapView objects without problems. Any idea why this is happening? I'm attempting to define the Spatial Reference inside the ngOnInit method within the code that gets called after the esri loader loads the ESRI modules -- same place as where the Map and MapView get created. Thanks Pete The ngOnInit method is below: ngOnInit (): void { loadModules ([ 'esri/Map' , 'esri/views/MapView' , 'esri/geometry/support/webMercatorUtils' , 'esri/geometry/Polygon' , 'esri/geometry/SpatialReference' ]) . then (([ EsriMap , EsriMapView , EsriwebMercatorUtils , EsriPolygon , EsriSpatialReference ]) => { ... //********the map and view get created fine:***************** const map = new EsriMap ({ basemap : 'streets' }); this . mapView = new EsriMapView ({ container : this . viewNode . nativeElement , center : [- 117.5 , 33.9 ], zoom : 10 , map : map }); //**************problem here ******************* this . sr = new __esri . geometry . SpatialReference ();//---> error here this . sr . wkid = 3857 ; //*************it can be autocasted // let sr = { // wkid:3857 // }
... View more
03-03-2021
02:52 PM
|
0
|
3
|
169
|
POST
|
thanks Kirk, I'll look into this. Are the WPF attributes implemented on the Config.daml or assigned in code? Pete
... View more
02-25-2021
01:26 PM
|
0
|
0
|
259
|
POST
|
Hi - I'm using condition="esri_mapping_layoutPane" in the Config.daml file to have a button be enabled only in layout mode. This was working until I recently upgraded ArcPro to 2.7.1. Has anything changed to make this not work anymore? the button is always disabled now <button id="BaseMapProModule_BtnMapDoc" caption="Map Doc" className="BtnMapDoc" loadOnClick="true" smallImage="Images\GenericButtonBlue16.png" largeImage="Images\GenericButtonBlue32.png" condition="esri_mapping_layoutPane"> Thanks Pete
... View more
02-25-2021
10:43 AM
|
0
|
4
|
311
|
Online Status |
Offline
|
Date Last Visited |
4 weeks ago
|