POST
|
Thanks Joel, That worked! Now, the obvious, next question: Can we add a list of custom layer declarations to the Legend's current list of declarations?
... View more
08-09-2023
09:42 PM
|
0
|
1
|
438
|
POST
|
Hi, I am trying to extend FeatureLayer in order to add minor, but important to me, functions and properties. When I do create and instance of the FeatureLayer sublayer, I can see no legend, where I do see a legend when I use the generic FeatureLayer. Even this example of a Sublayer for Feature layer does not show any symbols in the legend: @subclass("myproj.classes.layers.CustomFeatureLayer")
export class CustomFeatureLayer extends FeatureLayer {
//Purposely left empty to test legend
} What should I do to make a subclass of a FeatureLayer recognizable by the legend? Is there a function I can override in the Legend? Is there something I can add in the ActiveLayerInfo object to make the Legend pay attention?
... View more
08-09-2023
12:28 PM
|
0
|
4
|
494
|
POST
|
I am trying to extend the GraphicsLayerView in typescript. import GraphicsLayerView from "esri/views/layers/GraphicsLayerView"; @subclass("views.layers.My2dGraphicsLayerView") export My2dGraphicsLayerView extends GraphicsLayerView { } When I try to load my application in a browser, I get this exception message: Uncaught ReferenceError: GraphicsLayerview is not defined I even tried in plain old javascript and this class does not exist there. The GraphicsLayer is using a LayerView called GraphicsLayerView2D. This LayerView has no api documentation and seems to be a hidden, proprietary class. How do I extend GraphicLayerView functionality while still using the machanics of an existing, well designed, LayerView?
... View more
04-23-2021
05:22 PM
|
0
|
0
|
380
|
POST
|
I have this same issue, except I am not using Web AppBuilder. I am loading a public, wms layer over https via the proxy. Here is the link:https://community.esri.com/t5/arcgis-api-for-javascript/wmslayer-bypasses-proxy-when-using-getfeatureinfo/td-p/1044417 Can any let me know what I can do in the WMS layer to make it work the same as here?
... View more
04-14-2021
03:58 PM
|
0
|
0
|
790
|
POST
|
Hi Mitchell112, The fullExtent property of GraphicsLayer represents the entire earth, with the intersection of the equator and the prime meridian as the center(0,0). If you are getting the extents of a graphic layer to submit to the view for zooming, the view does this for you from the layre's graphics: view.goTo(graphicsLayer.graphics.toArray()); However, if you want these values for other purposes, a simple way is this. (There is, probably, a utility to get extents of an array of geometries, but this works just fine): //First, and obviously you want your layer to have all of its graphics, an empty layer wont work. graphicsLayer.graphics.push(...myArrayOfGraphics);//the ellipse (...) iterates the push method. // Start with the first graphic and iterate the layer's graphics to build extent let extent = graphicsLayer.graphics.getItemAt(0).geometry.extent; graphicsLayer.graphics.forEach((graphic)=>{ let gextent = graphic.geometry.extent; if(!gextent.equals(extent)){//this should only skip the first one extent = extent.union(gextent); } }); let center = exent.center;// The center of the layer's extent. //extent, above will be the entire extent of the layer's graphics.
... View more
04-11-2021
08:14 AM
|
1
|
0
|
1589
|
POST
|
Hi, We are displaying an ESRI for JS 4.17 map on an Angular 9 spa within an asp.net web app. We are trying to access EAGLE-I, WMS layer within our application. In our asp.net application, we have the ESRI proxy downloaded from https://github.com/Esri/resource-proxy. Our proxy configuration for the EAGLE-I url looks like this: <serverUrl url="https://eagle-i.doe.gov" matchAll="true" useAppPoolIdentity="false" accessToken="secret-token-number" tokenParamName="eiApiKey" rateLimit="-1" rateLimitPeriod="60" /> Loading a layer works perfectly. The WMS url is correctly forwarded through our proxy: http://localhost/SOCCSWebClient/gisapi/proxy.ashx?https://eagle-i.doe.gov/api/mapservices/geoserver/ows?width=1479&height=541&bbox=-18183495.26887799%2C2146991.791759475%2C-3713048.5701585496%2C7440103.126449953&format=image%2Fpng&request=GetMap&service=WMS&styles=&transparent=true&version=1.3.0&crs=EPSG%3A3857&layers=eagle-i%3Acoal_mines. But, when I click a feature from the map to view it’s popup, I get 401 error because the GetFeatureInfo call, first uses the proxy, but executes again without the proxy. What I see in the network tab of chrome's developer tools is the WMSLayer calls correctly the first time and then calls again, incorrectly a second time. Good call: http://localhost/SOCCSWebClient/gisapi/proxy.ashx?https://eagle-i.doe.gov/api/mapservices/geoserver/ows?bbox=-18183495.26887799%2C2171451.6408107243%2C-3713048.5701585487%2C7415643.277398704&format=image%2Fpng&request=GetFeatureInfo&service=WMS&styles=&transparent=true&version=1.3.0&crs=EPSG%3A3857&layers=eagle-i%3Acoal_mines&query_layers=eagle-i%3Acoal_mines&info_format=text%2Fhtml&feature_count=25&width=1479&height=536&I=704&J=373 Quickly negated by bad call: https://eagle-i.doe.gov/api/mapservices/geoserver/ows?bbox=-18183495.26887799,2171451.6408107243,-3713048.5701585487,7415643.277398704&format=image/png&request=GetFeatureInfo&service=WMS&styles=&transparent=true&version=1.3.0&crs=EPSG:3857&layers=eagle-i:coal_mines&query_layers=eagle-i:coal_mines&info_format=text/html&feature_count=25&width=1479&height=536&I=704&J=373 Any suggestion on how to fix this would be appreciated. Thanks in advance.
... View more
04-06-2021
02:43 PM
|
0
|
0
|
750
|
POST
|
OK I found from this article the sanitizer is the culprit: Using HTML with Popups in the ArcGIS API for JavaScript Since I already have the popup content returning from a function, I can manipulate the dom in this function. My change to the content function is this: var content = (incident) => { var incidentId = incident.graphic.attributes.INCIDENT_ID; var popId = 'inc-' + incident.graphic.attributes.INCIDENT_ID; var element = document.getElementById(popId); // Wrap the directive in a new div to avoid sanitation removing the img src url. var div = document.createElement("div"); div.innerHTML = element.innerHTML;// Wrapped return div; //return the wrapper };
... View more
09-24-2020
08:57 AM
|
0
|
0
|
1088
|
POST
|
While we are porting it over to Angular Cli 9.x with ESRI 4.16, we still have a production application written in Angular JS 1.5.9 and ESRI 4.15. The production application was originally written with ESRI 4.13, but we switch to 4.15 because the view rendering is so much faster than the former api. In the production app, we create an angular directive that we make the content of a graphics Popup Window using a function. Here is the code: var officeAction = { id: incident.popId, image: 'Content/images/MapLayerIcons/building.png', title: 'Offices' }; var content = (incident) => { var popId = incident.popId; var element = document.getElementById(popId); return element.innerHTML; }; var infoTemplate = new PopupTemplate({ title: "<strong>" + incident.title + "</strong>", content: content, actions: [officeAction] }); Here is what it looked like using ESRI 4.13: Here is what it looks like after upgrading to ESRI 4.15: Notice the HTML img is missing in the 4.15 popup, and this is our problem. We can not go back to 4.13 because we have feature layers that have over 120 thousand points and 4.13 is prohibitively slow. We can not move this particular version of the app to 4.16 because we have too many classes based on Accessor that take advantage of multiple inheritance, and would be spending too much time on a version of our application that we will soon sunset. I tried using a base64 encoded image and other tricks but, it seems the issue with image display in this one case is related to something different between 4.15s popup and 4.13s popup. I am unable to locate 4.15 documentation to try to trace down any sliver of a lead. Has anyone any ideas? Thanks ahead for any help.
... View more
09-23-2020
11:31 AM
|
0
|
1
|
1107
|
POST
|
We have an Angular CLI 9.1 application with esri api for js 4.15. We are using @arcgis/webpack-plugin and @types/arcgis-js-api. Everything works fine this way. I branched this solution and tried to upgrade the new branch with esri api for js 4.16. After reading "What's New", I removed all declared() wrapper function from my subClass declarations. After working through other errors, I have finally been stopped cold with this error. core.js:4127 ERROR TypeError: this.requestUpdateCallback is not a function at t.requestUpdate (GraphicsView2D.js:25) at t.viewChange (GraphicsView2D.js:25) at t.i.viewChange (GraphicsLayerView2D.js:25) at e._updateLayerView (FrameTask.js:25) at Array.forEach (<anonymous>) at t.forEach (Collection.js:25) at i.update (FrameTask.js:25) at scheduling.js:25 at t.forEach (PooledArray.js:25) at a (scheduling.js:25) This is with @types/arcgis-js-api 4.16.0. I don't get this error with @types/arcgis-js-api 4.15.0. Any help would be appreciated. Here is my tsconfig.json: { "compileOnSave": false, "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", "sourceMap": true, "strict": false, "alwaysStrict": false, "declaration": false, "checkJs": false, "downlevelIteration": true, "experimentalDecorators": true, "preserveConstEnums": true, "module": "ESNext", "importHelpers": true, "allowSyntheticDefaultImports": true, "noImplicitUseStrict": true, "noImplicitAny": false, "moduleResolution": "node", "esModuleInterop": true, "isolatedModules": false, "target": "ES5", "skipLibCheck": true, "typeRoots": [ "node_modules/@types" ], "lib": [ "es2015.promise", "es5", "es6", "dom" ] }, "angularCompilerOptions": { "fullTemplateTypeCheck": true, "strictInjectionParameters": true } } Here is the most important part of angular.json: "root": "./", "sourceRoot": "angularCLIsrc", "prefix": "", "architect": { "build": { "builder": "@angular-builders/custom-webpack:browser", "options": { "customWebpackConfig": { "path": "./custom-build.js" }, "rebaseRootRelativeCssUrls": true, "outputPath": "dist/esri", "index": "index.html", "main": "angularCLIsrc/main.ts", "polyfills": "angularCLIsrc/polyfills.ts", "tsConfig": "tsconfig.app.json",
... View more
08-06-2020
05:59 PM
|
0
|
0
|
349
|
POST
|
Thanks Robert, This works!!! Thanks!!! Change from != to = ! did the trick. Cheers to community brain trust.
... View more
05-15-2020
06:18 AM
|
0
|
0
|
1785
|
POST
|
I am working with esri gis api for js 4.15 typescript in an Angular 9 application. This works: var graphic = new graphic({geometry: point, symbol:sign}): var layer = new GraphicsLayer({id: 'mylayer'}); view.map.add(layer); layer.when((layerdone)=>{ setInterval(()=>{ graphic.visible != graphic.visible; }, 1000); }); layer.add(graphic); But this does not: var glayer = view.map.layers.find((layer)=>{ layer.id === 'mylayer'}); var graphic = glayer.graphics.find():// lets say its found var count = 0; var pulser = setInterval(()=>{ graphic.visible != graphic.visible; if((++count) >= 10){ clearInterval(pulser); pulser = undefined; graphic.visible = true; } }, 1000);
... View more
05-14-2020
06:24 PM
|
0
|
3
|
1831
|
POST
|
I solved this.. It was a race issue within a promise.
... View more
08-15-2019
01:12 PM
|
0
|
0
|
287
|
POST
|
Hi, I am using PrintTask to print a svg file. I read in the api document that the print server must be able to access the url of images displayed in the map, so I made sure the url for each image any PictureMarkerSymbol is a dataURL, but the graphic is still not being printed. Is there anything else I can try?
... View more
08-15-2019
12:37 PM
|
0
|
1
|
339
|
POST
|
Hi, I have a few questions about LayerViews that I can't seem to answer anyplace else: 1. - What is the lifecycle of a LayerView, specifically the GraphicsLayerView ("esri/views/2d/layers/GraphicsLayerView2D") or FeatureLayerView. I looking for something like: attach, cache and watch graphics, render, catch update events and render, detach? 2. - can I tell the LayerView to watch an alternate graphics or source collection than the main one for the layer? 3. - Can I create a subclass of the GraphicsLayerView or FeatureLayerView, and override attach to set up my own graphics caching while allowing the LayerView to do all of its other functions about which I don't care? A single layer can be watched by several views and each view can have a different zoom reference to the same layer, so our old clustering logic will only work in one view and cause or graphics to llogically display in other views since it replaces the content of the layer graphics for all views. What I want to do is create a custom LayerView that extends the Graphics or Feature layer, avoiding the task of writing gfx code, and replace or override its graphics collection with one I can control. I want to be able to give that LayerView only those graphics that are available at that view's, resolution and zoom level. If zoomed out, some features will be clustered, when zoomed in, those features will be individuals again. If the solution is as simple as asking the existing LayerView to change its relationship to the layer's graphics, then I am very open to this.
... View more
05-25-2019
10:16 AM
|
3
|
0
|
499
|
Title | Kudos | Posted |
---|---|---|
1 | 04-11-2021 08:14 AM | |
3 | 05-25-2019 10:16 AM |
Online Status |
Offline
|
Date Last Visited |
02-14-2024
02:00 PM
|