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
|
327
|
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
|
1418
|
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
|
1417
|
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
|
1
|
2018
|
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
|
390
|
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
|
3058
|
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
|
3
|
1500
|
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
|
1605
|
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
|
1605
|
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
|
1902
|
POST
|
It works out right after I locate my image in url:"localhost:{Port}/{Project name}/cocacola.png", so if anyone is looking for a non-CORS/proxy-related solution, try my approach. Thanks for your reply tho.
... View more
09-04-2019
05:45 PM
|
0
|
0
|
723
|
POST
|
I'm trying to use an existing png image as customised PictureMarkerSymbol. The image is in the same folder as my .NET project(.sln) is. When I try the url : "https://static.arcgis.com/images/Symbols/Shapes/BlackStarLargeB.png", it works like it should. But when I try my locally hosted image, the symbol turns into black dots instead of the image I want to show. The browser returns the error : Access to image at 'http://{My IP}:{Port}/cocacola.png' from origin 'http://localhost:49387' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. The document offers three approaches to avoid CORS issues : To me, enabling CORS and proxy is too complicated and time-consuming, so I went for hosting the image on the same domain. My issue is, am I doing it right putting the image in the same folder as the project file? If i am, why does it still seem like a CORS issue?
... View more
09-02-2019
07:05 PM
|
0
|
2
|
944
|
POST
|
The map shows after I put Spectrum CDN above the ESRI API script. But the ColorPicker is still a default text input box, and it's placed outside the map. I'm so stuck on this. I've tried only the ColorPicker code on CodePen and it works perfectly, but not when I tried to place it on my map. What should I do to get the ColorPicker to work with the ArcGIS API?
... View more
08-28-2019
07:24 PM
|
0
|
1
|
1323
|
POST
|
Thank you for your reply, but I still get blank page after I include the Spectrum CDN. <script src="https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.css"> Is there any further requirement to implement Spectrum ColorPicker to ArcGIS API map?
... View more
08-28-2019
06:57 PM
|
0
|
2
|
1323
|
POST
|
I can only find ColorPicker in ArcGIS JavaScript API 3.X, but I'm working on a project using 4.12. I'm trying to implement ColorPicker to my map to allow users to choose colors for Sketch objects. I've included both 4.12 and 3.29 APIs in my code as well as required "esri/dijit/ColorPicker", then the website just turned into a blank white page. Obviously it doesn't work this way. So, is there any other way to implement ColorPicker in a API v4.12 project?
... View more
08-27-2019
11:50 PM
|
0
|
5
|
1735
|
Title | Kudos | Posted |
---|---|---|
2 | 09-16-2019 09:32 AM | |
1 | 10-02-2019 08:47 PM | |
1 | 09-09-2019 11:55 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|