POST
|
If you have access to the ArcGis Servers a Server Object Interceptor (SOI) might work for you. We implemented a Feature Level security for a client. When the request for an edit/update/delete came in, we grabbed it, looked up the user to see if they had access to that feature, if so, we let the call go through, if not, we send back an error. It's an entirely different toolset than your using on the client side. A simpler option is to have two sets of Services, one for viewing and one for editing. Then lock the editable services down to just the groups you wish to have edit privileges. Another option is to set up a proxy - send your calls through the proxy, check security and pass or reject. Again, probably a different toolset than you might be used to. This solution also has the Client-Side only issues listed below. Your current option is not a bad one either. But with a client-side only solution is that you still will have a back door. The widget might be disabled, but the rest endpoint would still be active and open.
... View more
01-26-2018
07:32 AM
|
1
|
0
|
1009
|
POST
|
This is a longshot but.... There was an issue with the MaptoJSON in the PrintTask. We ripped the code from the Core Libs, beautified them up, and found where we could add our hook. We then overrode the Execute() method, adding our fixes. [jsbeautifier.org] Perhaps you could do the same with the featureLayer class? Inherit the class, override the http call(s) and add your headers. My example of overriding the execute method of the PrintTask: (function (wapp) { wapp.objects = wapp.objects || {}; require([ "esri/tasks/PrintTask", "esri/core/Accessor" ], function ( EsriPrintTask, Accessor ) { // Handle redline Polygons/Cirles wapp.objects.CustomPrintTask = EsriPrintTask.createSubclass({ execute: function (a, b) { internalPrintPrams = this._setPrintParams(a); // parse current esri version var mapJson = JSON.parse(internalPrintPrams.Web_Map_as_JSON); // add rotation mapJson.mapOptions.rotation = -1 * a.view.rotation; // Force scale mapJson.mapOptions.scale = a.view.scale; // create visibleLayers node $(mapJson.operationalLayers).each(function (opIdx, opLayer) { var visibleLayers = []; $(opLayer.layers).each(function (subIdx, subLayer) { visibleLayers.push(subLayer.id); }); opLayer.visibleLayers = jQuery.makeArray(visibleLayers); })// for each Operational Layer // Remove empty layers mapJson.operationalLayers = jQuery.grep(mapJson.operationalLayers, function (layer, idx) { return ((layer.visibleLayers.length > 0) || ((layer.featureCollection) && (layer.featureCollection.layers) && (layer.featureCollection.layers.length > 0))); }); // grep Operational Layers // Add "style": "esriSMSCircle", to draw features that don't have it jQuery.each(mapJson.operationalLayers, function (opIdx, opLayer) { if ((opLayer.featureCollection)&&(opLayer.featureCollection.layers) && (opLayer.featureCollection.layers.length > 0)) { jQuery.each(opLayer.featureCollection.layers, function (featureSetIdx, featureSet) { jQuery.each(featureSet.featureSet.features, function (featureIdx, feature) { if ((feature.symbol)&&(!feature.symbol.style)) { feature.symbol.style = "esriSMSCircle"; } }); // for each featureSet }); } }); // for each opLayer, add style to symbols that don't have it internalPrintPrams.Web_Map_as_JSON = JSON.stringify(mapJson); return this._geoprocessor["async" === this.mode ? "submitJob" : "execute"](internalPrintPrams, b) .then(this._handleExecuteResponse) } }); }); // require }(window.wapp = window.wapp || {})); arrg (how do you get "code" formatting here?)
... View more
01-26-2018
06:43 AM
|
0
|
0
|
2840
|
POST
|
Oh, and you can ignore the Graphics stuff - there is an error printing custom graphics that is probably not needed for what you are doing. We had an odd requirement to have unique graphics for each feature.
... View more
10-28-2017
06:48 AM
|
0
|
0
|
1635
|
POST
|
I'll try to set something up. But you can see rotation and the visible layer issue right away. Simply rotate the map and print. The map will not be rotated with 4.3 - It's simply not there. Same with opLayer.visibleLayers .
... View more
10-28-2017
06:47 AM
|
0
|
1
|
1635
|
POST
|
np, let me know if you have any questions. Basically, all it does is intercept the WebMapToJson and make some tweaks to add Visibility and rotation.
... View more
10-28-2017
06:45 AM
|
0
|
0
|
1635
|
POST
|
There is a bug in the Web_Map_as_JSON of the EsriPrintTask. I worked around it by creating my own subclass and walking the layer chain and building the visibility list. (function (wapp) { wapp.objects = wapp.objects || {}; require([ "esri/tasks/PrintTask", "esri/core/Accessor" ], function ( EsriPrintTask, Accessor ) { wapp.objects.CustomPrintTask = EsriPrintTask.createSubclass({ execute: function (a, b) { internalPrintPrams = this._setPrintParams(a); // parse current esri version var mapJson = JSON.parse(internalPrintPrams.Web_Map_as_JSON); // add rotation mapJson.mapOptions.rotation = -1 * a.view.rotation; // Force scale mapJson.mapOptions.scale = a.view.scale; // create visibleLayers node $(mapJson.operationalLayers).each(function (opIdx, opLayer) { var visibleLayers = []; $(opLayer.layers).each(function (subIdx, subLayer) { visibleLayers.push(subLayer.id); }); opLayer.visibleLayers = jQuery.makeArray(visibleLayers); })// for each Operational Layer // Remove empty layers mapJson.operationalLayers = jQuery.grep(mapJson.operationalLayers, function (layer, idx) { return ((layer.visibleLayers.length > 0) || ((layer.featureCollection) && (layer.featureCollection.layers) && (layer.featureCollection.layers.length > 0))); }); // grep Operational Layers // Add "style": "esriSMSCircle", to draw features that don't have it jQuery.each(mapJson.operationalLayers, function (opIdx, opLayer) { if ((opLayer.featureCollection)&&(opLayer.featureCollection.layers) && (opLayer.featureCollection.layers.length > 0)) { jQuery.each(opLayer.featureCollection.layers, function (featureSetIdx, featureSet) { jQuery.each(featureSet.featureSet.features, function (featureIdx, feature) { if ((feature.symbol)&&(!feature.symbol.style)) { feature.symbol.style = "esriSMSCircle"; } }); // for each featureSet }); } }); // for each opLayer, add style to symbols that don't have it internalPrintPrams.Web_Map_as_JSON = JSON.stringify(mapJson); return this._geoprocessor["async" === this.mode ? "submitJob" : "execute"](internalPrintPrams, b) .then(this._handleExecuteResponse) } }); }); // require }(window.wapp = window.wapp || {}));
... View more
10-23-2017
07:11 AM
|
0
|
3
|
1635
|
POST
|
Just to save someone some linking in the future. I pulled the relevant code: require([ "esri/Map", "esri/views/MapView", "esri/layers/support/LOD", "dojo/domReady!" ], function (Map, MapView, LOD) { var lods = []; var tilesize = 256; var earthCircumference = 40075016.685568; var halfEarthCircumference = halfEarthCircumference * 0.5; var inchesPerMeter = 39.37; var initialResolution = earthCircumference / tilesize; for (var zoom = 0; zoom <= 27; zoom++) { var resolution = initialResolution / Math.pow(2, zoom); var scale = resolution * 96 * inchesPerMeter; lods.push(new LOD({ level: zoom, scale: scale, resolution: resolution })); } var map = new Map({ basemap: "streets" }); var view = new MapView({ container: "viewDiv", map: map, zoom: 18, center: [-104.991531, 39.742043], constraints: { lods: lods } }); });
... View more
06-22-2017
08:13 AM
|
1
|
0
|
460
|
POST
|
I was, and Really? Arrg. This 3.x to 4x has been painful.
... View more
06-21-2017
10:42 AM
|
0
|
1
|
2962
|
POST
|
Brandon, I can help if you are up for working remotely. PM me at jordanbaumgardnerbtc@gmail.com I've been doing Esri JS for a few years now and just completed a 3.x to 4x upgrade so I'm very familiar with the new(ish) sdk.
... View more
06-21-2017
08:47 AM
|
2
|
0
|
694
|
POST
|
I think the way you did it is perfectly acceptable. We have done many similar things (overlaying multiple symbols, text, alter colors, ect). The only other way I could think of to do what you want is with a Lable and use the Lable offset to position it directly over the current point.
... View more
06-21-2017
08:35 AM
|
0
|
3
|
2962
|
POST
|
We had the same issue using the iOs SDK in a native app. Our mobile developer was able to (add or remove I can't remember) a metadata tag that was forcing the rotate on other devices when displayed. I'll try and dig up the specifics. But I think if you compare the metadata tags from a iOs vs some other that tag should show up quickly.
... View more
06-21-2017
08:30 AM
|
1
|
0
|
1601
|
POST
|
I had a bit of trouble running this down. Thought it might help someone. IMxDocument pMxDoc = (IMxDocument)ArcMap.Application.Document;
IContentsView pTOC = pMxDoc.CurrentContentsView;
IFeatureLayer exportLayer = (IFeatureLayer)pTOC.SelectedItem; // Selected Layer
if (!exportAll)
{
IFeatureLayerDefinition iDefLayer = (IFeatureLayerDefinition)pTOC.SelectedItem;
exportLayer = iDefLayer.CreateSelectionLayer(pTOC.Name, true, null, null); // Selected features
}
Geoprocessor gp = new Geoprocessor();
gp.OverwriteOutput = true;
gp.AddOutputsToMap = false;
LayerToKML layerToKML = new LayerToKML();
layerToKML.layer = exportLayer;
layerToKML.layer_output_scale = 10000;
layerToKML.out_kmz_file = fileName;
try {
object result = gp.Execute(layerToKML, null);
messages = new string[gp.MessageCount];
for (int i = 0; i < gp.MessageCount; i++)
{
messages = gp.GetMessage(i);
}
return true;
}
catch (Exception ex) {
messages = new string[gp.MessageCount];
for (int i = 0; i < gp.MessageCount; i++)
{
_logger.Error($"GP Message #{i} :"+gp.GetMessage(i));
}
return false;
}
... View more
06-13-2017
09:20 AM
|
0
|
0
|
478
|
POST
|
Make sure it's the right "Type". You are always using an ArcGISDynamicMapServiceLayer - Does that match your URL? or are you hitting a /MapService or an /ImageService?
... View more
06-12-2017
08:01 AM
|
0
|
0
|
3090
|
POST
|
I took a quick look at your code and didn't see anything obvious with regards to variable scoping. But, you may want to take a different approach. If you limited your log entries by Distance and not Time you would save a lot of space. Meaning, Only log points that are X meters apart from the last logged point.
... View more
06-12-2017
07:59 AM
|
0
|
2
|
1022
|
POST
|
I have the same issue in IE 11, windows 10, Esri JS SDK 4.3 I've tried every possible <meta tag stuff I could find on the interweb. What is weird is our 3.x version works great. The same <meta tag from our 3.x version still has the 4.3 version not work. My guess is that the map never even sees the pinch and the browser does its normal sizing thing. There must be a way to shut that off. Things I've tried: <meta name=”viewport” content=”width=device-width” /> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" /> <meta name="viewport" content="target-densitydpi=device-dpi, initial-scale=1.0, user-scalable=no" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> Any thoughts would be most appreciated.
... View more
04-19-2017
10:26 AM
|
0
|
0
|
815
|
Title | Kudos | Posted |
---|---|---|
1 | 09-16-2025 09:54 AM | |
1 | 05-12-2014 01:47 PM | |
1 | 06-22-2017 08:13 AM | |
1 | 02-12-2018 09:03 AM | |
1 | 01-28-2016 03:55 PM |
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|