POST
|
Use toJSON and fromJSON. To save the current basemap to localstorage, for example: let basemapGallery = new BasemapGallery({ view: view }); basemapGallery.watch("activeBasemap", (evt) => { localStorage.opsBaseMap = JSON.stringify(evt.toJSON()); }); To load the basemap into a new Map: require(["esri/views/MapView", "esri/Map", "esri/Basemap"], (MapView, Map, Basemap) => { let tmap = Basemap.fromJSON(JSON.parse(localStorage.opsBaseMap)); map = new Map({ basemap: tmap }); });
... View more
09-06-2022
06:39 AM
|
0
|
0
|
1298
|
POST
|
Try the code below. The get_length is another function that just uses the geometryEngine length function. This works for a single part polyline. function midPointPolyline(line) { var path = line.paths[0]; var seglen = get_length(line, "feet"); var midLen = seglen / 2; var currentDistance = 0; var beforeIndex = 0; var startPoint = line.getPoint(0, 0); for (i = 1; i < path.length - 1; i++) { var nextPoint = line.getPoint(0, i); var d = geometryEngine.distance(startPoint, nextPoint, "feet"); if (currentDistance + d < midLen) { currentDistance += d; startPoint = nextPoint; } else { beforeIndex = (i === 1) ? 0 : i; break; } } startPoint = line.getPoint(0, beforeIndex); var endPoint = line.getPoint(0, beforeIndex + 1); var x = (startPoint.x + endPoint.x) / 2; var y = (startPoint.y + endPoint.y) / 2; var midpt = new esri.geometry.Point({ x, y, spatialReference: { wkid: line.spatialReference.wkid } }); return midpnt; }
... View more
08-27-2020
05:18 AM
|
1
|
1
|
4255
|
POST
|
Try the code below. The get_length is another function that just uses the geometryEngine length function. This works for a single part polyline. function midPointPolyline(line) { var path = line.paths[0]; var seglen = get_length(line, "feet"); var midLen = seglen / 2; var currentDistance = 0; var beforeIndex = 0; var startPoint = line.getPoint(0, 0); for (i = 1; i < path.length - 1; i++) { var nextPoint = line.getPoint(0, i); var d = geometryEngine.distance(startPoint, nextPoint, "feet"); if (currentDistance + d < midLen) { currentDistance += d; startPoint = nextPoint; } else { beforeIndex = (i === 1) ? 0 : i; break; } } startPoint = line.getPoint(0, beforeIndex); var endPoint = line.getPoint(0, beforeIndex + 1); var x = (startPoint.x + endPoint.x) / 2; var y = (startPoint.y + endPoint.y) / 2; var midpt = new esri.geometry.Point({ x, y, spatialReference: { wkid: line.spatialReference.wkid } }); return midpnt; }
... View more
08-27-2020
05:16 AM
|
0
|
0
|
539
|
POST
|
Issue with iOS Safari on touch only devices like iPhones and iPads. Do not have the ability to close or dock the popup by clicking on the respective popup icons. The problem does not exist for Android devices (chrome). Also, all seemed to work under JS API 3x. Is this a bug, am I missing something, or is there a work around?
... View more
07-16-2019
05:50 AM
|
0
|
0
|
183
|
POST
|
Still have not found an answer to this issue. What I have observed is that when you publish a MXD using Share As inside of ArcMap, the MXD is copied before the SD is created. Opening this copy, I have noticed that the label field name gets truncated from a fully qualified name to the short name. I have only tested under Server 10.1. Has any one else noticed this issue?
... View more
09-05-2013
07:26 AM
|
0
|
0
|
385
|
POST
|
SDE has been registered inside of ArcGIS Server using Manager. All fully qualified field names appear when viewing the service under REST.
... View more
09-03-2013
06:40 AM
|
0
|
0
|
385
|
POST
|
Created a map service that contains a feature class that has a joined table. This feature class labels fine in the MXD but does not label when posted as a map service. Under further investigation, the label field name gets changed to a local name not a fully qualified name. For example, FULL_ADD is in the map service while sde.sde.FULL_ADD in in the map document. Does anybody have a fix or work around? I would prefer not to add the same layer to the MXD just to label.
... View more
09-03-2013
04:22 AM
|
0
|
3
|
731
|
POST
|
Using ArcServer 10.1 and JSAPI 3.1. Printtask works when selection of a featurelayer under a feature service is empty. After a selection is made the follow error occurs: Layer "graphicsLayer0": Failed to create layer from service at http://darkside:6080/arcgis/rest/services/TheAddresser/YorkCounty_SDE/FeatureServer/0. Failed to execute (ExportWebMap). Failed to execute (Export Web Map). This feature service is secured. Anyone have any ideas? Sample code below. var printTask = new esri.tasks.PrintTask(url); var templateP = new esri.tasks.PrintTemplate(); templateP.format = "PDF"; templateP.layout = "85x11"; templateP.preserveScale = true; template.layoutOptions = { titleText: '', authorText: "ME", scalebarUnit: 'Feet', legendLayers: [] }; var params = new esri.tasks.PrintParameters(); params.outSpatialReference = map.spatialReference; params.map = map; params.template = templateP; printTask.execute(params, function (result) { window.open(result.url); hideWorking(); }, function (err) { errorWin(err, 'printMap'); });
... View more
09-10-2012
07:45 PM
|
0
|
13
|
3280
|
Title | Kudos | Posted |
---|---|---|
1 | 08-27-2020 05:18 AM |
Online Status |
Offline
|
Date Last Visited |
Tuesday
|