POST
|
I'm trying to retrieve the graphic instance when it's being created so I can setAttribute to it then manipulate the specific graphic afterwards.
... View more
12-15-2019
07:19 AM
|
0
|
1
|
65
|
POST
|
I'm getting '#load() Failed to load layer TypeError: Cannot read property 'indexOf' of undefined' error when I tried to load WMSLayer in my application. I've tried several different WMS service URLs but with no positive results. The code from the official sample doesn't work either. A similar question has been asked and someone suggested that using proxy might solve the issue, but implementing proxy seems to be a quite complicated process. Please note that the URL in the question has http instead of https like in my application, the error is different from what I'm getting as well. Does anyone figure out what I'm doing wrong or anything I missed out? Here's my code : let wmsLayer = new WMSLayer ({ title : "WMS Layer" , url : "https://ows.terrestris.de/osm/service" , sublayers : [{ name : "OSM-WMS" }] }); var basemap = new Basemap ({ baseLayers : [ wmsLayer ] }); var map = new Map ({ basemap : basemap , layers : [ gridLayer , forceSymbolLayer , measurementLayer , sketchLayer ] }); var mapView = new MapView ({ map : map , zoom : initZoom , center : initPosition });
... View more
12-12-2019
12:04 AM
|
0
|
1
|
361
|
POST
|
I'm working with JavaScript API 4.12. I tried using the url in Sample - WMSLayer which should work fine but instead giving me the error '[esri.layers.WMSLayer] #load() Failed to load layer (title: 'WMS Layer', id: '16ef4567998-layer-4') TypeError: Cannot read property 'indexOf' of undefined'. let wmsLayer = new WMSLayer({ title: "WMS Layer", url: "https://ows.terrestris.de/osm/service", sublayers: [ { name: "OSM-WMS" } ] }); Thought it was a spatial reference relevant error, I've tried setting 'wmsLayer.spatialReference = 102100;' but still got the same error. After googling WMS url usage, I tried putting the url with the complete parameters and got a 'XML Parse error '. let wmsLayer = new WMSLayer({ title: "WMS Layer", url: "https://neo.sci.gsfc.nasa.gov/wms/wms?version=1.3.0&request=GetMap&layers=MOD14A1_M_FIRE&style=rgb&crs=CRS:84&bbox=-180,-90,180,90&width=720&height=360&format=image/png" }); var basemap = new Basemap({ baseLayers: [wmsLayer] }); var map = new Map({ basemap: basemap, layers: [gridLayer, forceSymbolLayer, measurementLayer, sketchLayer] }); I'm new to the GIS development, and really confused about the WMS format to set as the url, especially when the sample from official website doesn't work.
... View more
12-11-2019
02:04 AM
|
0
|
1
|
432
|
POST
|
I'm using ArcGIS JSAPI 4.12 and wishing to use Spatial Illusions to draw military symbols on map. When I add milsymbol.js to script, the console returns error Uncaught SyntaxError: Cannot use import statement outside a module , so I add type="module" to the script, the it returns Uncaught ReferenceError: ms is not defined . Here's my code: < link rel = "stylesheet" href = "https://js.arcgis.com/4.12/esri/css/main.css" > < script src = "https://js.arcgis.com/4.12/" > </ script > < script type = "module" src = "milsymbol-2.0.0/src/milsymbol.js" ></ script > < script > require ([ "esri/Map" , "esri/views/MapView" , "esri/layers/MapImageLayer" , "esri/layers/FeatureLayer" ], function ( Map , MapView , MapImageLayer , FeatureLayer ) { var symbol = new ms . Symbol ( "SFG-UCI----D" , { size : 30 }). asCanvas ( 3 ); var map = new Map ({ basemap : "topo-vector" }); var view = new MapView ({ container : "viewDiv" , map : map , center : [ 121 , 23 ], zoom : 7 }); }); </ script > So, whether I add type="module" or not, there's always errors. However, in the official document of Spatial Illusions, there's no type="module" in the script. I'm now really confused, how do they manage to get it work without adding the type? milsymbol.js import { ms } from "./ms.js" ; import Symbol from "./ms/symbol.js" ; ms . Symbol = Symbol ; export { ms };
... View more
10-02-2019
08:47 PM
|
1
|
2
|
645
|
POST
|
I'm using IIS Express as server for my application. I've created a map that allows users to input lat and long to draw Symbols on map. Now my goal is to allow users to see other users' Symbols in real-time as they add it to the map without refreshing the page. For instance, UserA draws a Symbol on [121, 24]; UserB must see the Symbol drawn by UserA in real-time. My issue is that I have little knowledge of client-server, so it's nearly impossible for me to sort the code out, not to mention using WebSockets. But I still have to finish the project, so wanna know anyone knows how to real-time update using long-polling?
... View more
09-17-2019
09:50 AM
|
0
|
0
|
55
|
POST
|
I have a div that I want to put inside the map, but either placing 'sidePanel' outside or inside 'viewDiv' don't work. I'm curious about is there any approach other than customizing a widget with TypeScript and SASS? To be specific, is it possible to do those widget tricks with generic HTML and CSS like I'm attempting? my code : Snippet < style > html , body , #viewDiv { padding : 0 ; margin : 0 ; height : 100% ; width : 100% ; } #sidePanel { background-color : #f00 ; height : 100px ; width : 100px ; } </ style > Snippet < div id = "sidePanel" ></ div > < div id = "viewDiv" class = "esri-widget" ></ div > screenshot :
... View more
09-16-2019
09:32 AM
|
2
|
2
|
968
|
POST
|
I'm working on making LayerList items to be draggable so that users would be able to reorder the layers by dragging them. I've found Shopify Draggable might be the closest approach. However, the application(open CodePen) loses some of its functionalities after the LayerList is dragged. It's a shame that v4.x doesn't support dragging natively like v3.x did. Is there any other way to perfectly reorder LayerList layers with dragging?
... View more
09-09-2019
11:55 PM
|
1
|
1
|
278
|
POST
|
Thanks for your suggestion, Ben. But unfortunately, I have non-text images so using TextSymbols may not be a solution. What I need to achieve is to transform HTML5 canvas into a ArcGIS Graphic like I mentioned under Robert's comment.
... View more
09-05-2019
06:33 PM
|
0
|
1
|
215
|
POST
|
I also have GIFs that are not texts so I need url reference to each of my images which a TextSymbol is lack of. I've successfully changed image color using HTML5 canvas, but I have no clue how to implement it in the an ArcGIS map. I found v3.x APIs seem to support canvas, but not in v4.x. By the way, sorry for providing too little detail.
... View more
09-05-2019
06:23 PM
|
0
|
1
|
215
|
POST
|
I have GIF images as PictureMarkerSymbols. The images are filled in black(as shown below, the letters 'N', 'F', 'R', 'L', 'Z'). Now I want to change the color of these GIFs to red or blue. I've tried some changing color codes in JS, but I'm not able to work them out successfully. Is there any other way to change GIF color dynamically in code in ArcGIS API? Thanks so much! Snippet of my code : var letterGraphic = new Graphic({ geometry: { type: "multipoint", points: [[0, 12]] }, symbol: { type: "picture-marker", url: "http://localhost:{Port}/{Project name}/letterR.gif", width: "80px", height: "80px" } }); view.graphics.add(letterGraphic);
... View more
09-04-2019
06:35 PM
|
0
|
6
|
512
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|