POST
|
thanks for the reply - I've used that before - however that is for WebApps and limiting access. works basically like a reverse proxy to block everything except a list of URLs In this case I'm using a desktop based app to sync data to a locally stored gdb via REST - little bit different. I've submitted a ticket to ESRI support so lets see what they say - will post result if they can solve it.
... View more
06-02-2021
11:57 PM
|
0
|
0
|
863
|
POST
|
I'm also having similar token issue I'm using the following in C# and the RestSharp library it works perfectly in AGOL- and am able to Query data from the FeatureService. but when using against our Portal it gets a token, however it is unable to use it for hitting REST endpoints to Query - throws an error. "{\"error\":{\"code\":498,\"message\":\"Invalid Token\",\"details\":[]}}" RestRequest r = new RestRequest(tokenUrl);
r.AddParameter("client_id", client_id);
r.AddParameter("client_secret", client_secret);
r.AddParameter("grant_type", "client_credentials");
r.Method = RestSharp.Method.POST;
r.RequestFormat = DataFormat.Json;
RestClient c = new RestClient();
IRestResponse rs = c.Execute(r);
JsonDeserializer a = new JsonDeserializer();
Dictionary<string, string> d = a.Deserialize<Dictionary<string, string>>(rs);
accessToken = d["access_token"];
... View more
06-02-2021
09:11 PM
|
0
|
0
|
869
|
POST
|
After downloading the API and actually formatting labelLayer.js into a readable state... i found a few key things. have to set the pointPriorities in the "addFeatureLayer" function.. and not as "params?" in the constructor. and the thing not in the API is to set the AlgorithmType to "DYNAMIC" then it will label much nicer .. default is "STATIC".
labelLayer.addFeatureLayer(featureLayer, renderer, "{SamplePointName}", { pointPriorities: "AboveLeft" });
labelLayer.setAlgorithmType("DYNAMIC"); //this is not in API Document
hope this can help others that have had / having same issues.. Tomas
... View more
07-29-2015
12:20 AM
|
1
|
0
|
757
|
POST
|
I've found a solution which is a cross of css and SVG filter manipulation will make it a bit nicer but here is a good way of doing it... it seems Internet Explorer hates text-shadow for some reason, and it needs to be a backward compatible solution. text {
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white !Important;
filter: url(#drop-shadow);
}
<filter id="drop-shadow">
<feFlood flood-color="white" result="base" />
<feMorphology result="bigger" in="SourceGraphic" operator="dilate" radius="1" />
<feColorMatrix result="mask" in="bigger" type="matrix"
values="0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 1 0" />
<feComposite result="drop" in="base" in2="mask" operator="in" />
<feGaussianBlur result="blur" in="drop" stdDeviation="1" />
<feBlend in="SourceGraphic" in2="blur" mode="normal" />
</filter>
After downloading the API and actually formatting labelLayer.js into a readable state... i found a few key things. have to set the pointPriorities in the "addFeatureLayer" function.. and not as "params?" in the constructor. and the thing not in the API is to set the AlgorithmType to "DYNAMIC" then it will label much nicer .. default is "STATIC". labelLayer.addFeatureLayer(featureLayer, renderer, "{SamplePointName}", { pointPriorities: "AboveLeft" }); labelLayer.setAlgorithmType("DYNAMIC"); //this is not in API Document
hope this can help others that have had / having same issues..
... View more
06-27-2015
05:16 PM
|
1
|
0
|
757
|
POST
|
Hi All, I've got a problem when I'm trying to create labels using Label Layer for a featureLayer i create on the fly (using a JSON FeatureCollectionObject) Label Placement of DynamicLayers seems like it is so much better.....but I have a requirement to generate the layer on the fly.. Symbology is fine, that seems to be working no worries. I'm using the standard way of defining the TextSymbol Object as according to the API Documentation, and it states you can use halo, but it seems to ignore it, even though when i look at the object in the code, it has correctly parsed it. I also tried including the 'LabelingInfo' in the LayerDefinition JSON, and set showLabels: true when i create the Map and it seems to ignore that also. (which states in the API Documentation that it will work for featureLayers) var symbol = new esri.symbol.TextSymbol({
"type": "esriTS",
"color": [
52,
52,
52,
255
],
"backgroundColor": null,
"borderLineColor": null,
"borderLineSize": null,
"verticalAlignment": "bottom",
"horizontalAlignment": "left",
"rightToLeft": false,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"kerning": true,
"haloColor": [
255,
255,
255,
255
],
"haloSize": 1,
"font": {
"family": "Arial",
"size": 8,
"style": "normal",
"weight": "bold",
"decoration": "none"
}
});
var renderer = new esri.renderer.SimpleRenderer(symbol);
var labelLayer = new esri.layers.LabelLayer("label1", { mode: "dynamic" });
labelLayer.addFeatureLayer(featureLayer, renderer, "{ObjectName}");
mapObj.addLayer(labelLayer); "labelingInfo": [
{
"labelPlacement": "esriServerPointLabelPlacementAboveRight",
"where": null,
"labelExpression": "[ObjectName]",
"useCodedValues": true, not using dynamic layer...as you can see i'm getting no halo.. and placement is always top right regardless. its barely even usable in its current state in my opinion. i know there is probably a 'css' workaround for the halo.. but i'd prefer a nicer solution using Dynamic service layer (static testing).. labels seem fine. another quirk is you notice the roughness of the symbol when using Dynamic Service Layer..., compared to the manual specification of the symbol in the featureLayer.. odd..
... View more
06-23-2015
04:48 PM
|
0
|
3
|
4466
|
POST
|
Hi, I'm trying to run a very simple Export mapbook mxd's to pdf, while i'm using the ArcGIS Engine License in my C#.net application.. the problem is you cannot export mapbooks (from my what I've read on here) using ArcObjects, so i've written a .py script to be fired from my application... it works fine in my development environment and on my development PC... uses the 64 bit python exe. when it comes to deploying it to a machine with a standalone Engine license, the script fails I've trying a whole bunch of things including "import arcengine" at the top.... still no success any help would be greatly appreciated. Tomas. # Set license used
import arcengine
# import the required modules for the python script
import arcpy
# Script arguments - production
mxdloc = arcpy.GetParameterAsText(0)
outputfolder = arcpy.GetParameterAsText(1)
figprefix = arcpy.GetParameterAsText(2)
mxd = arcpy.mapping.MapDocument(mxdloc)
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
arcpy.mapping.ExportToPDF(mxd, outputfolder + figprefix + str(mxd.dataDrivenPages.pageRow.Figure_No) + ".pdf")
arcpy.AddMessage("Exported: " + figprefix + str(mxd.dataDrivenPages.pageRow.Figure_No) + " to " + outputfolder)
del mxd
... View more
07-17-2013
06:19 PM
|
0
|
0
|
2150
|
POST
|
ok seems like no one here is doing this ?? I've done a work around and implemented my own "Geodatabase Synchronisation" via a USB thumb drive master. anyone else attempted that kindof thing ?? its quite easy using GUIDs, you just need to use your "own" GUID field as the ESRI GlobalID fields are readonly. which is a fail at adding new feature with a "sync'd" GUID from another geodatabase. this deprecates the need for a live sync to server solution for the moment, but it would be nice to know how do to the Feature Service stuff at some point.. ?? maybe it's coming with the Winforms SDK for 2012 VS. ?? I won't hold my breath
... View more
05-19-2013
05:47 PM
|
0
|
0
|
247
|
POST
|
just throw them into a list of strings first? I use c# to code in, but its pretty simple in both languages. using system.Collections.Generic; List<String> cblist = new List<String>(); cblist.Items.Add(Value); cblist.Sort(); then you can either bind the list to the Combo box, or manually add them in by looping 🙂 Tomas.
... View more
05-19-2013
05:41 PM
|
0
|
0
|
854
|
POST
|
anyone got any information on this?? will probably implement REST if no one has any other solutions ??
... View more
04-30-2013
08:52 PM
|
0
|
0
|
247
|
POST
|
Hi :cool: I've developed an application in ArcGIS Engine in C#.net that works perfectly with anything local (gdb, shape, raster, dwg) and now I'm trying to get it working with ArcGIS Server layers etc. trying to consume a Feature Service with Editing/Query/Create/Delete enabled.... the map control accepts the layer, and displays the data. "/SpatialDataServer/admin/services/Sandbox_TestLayer.FeatureServer/0" however upon Query / add feature / edit, it seems the layer needs to be treated differently.. it edits and queries fine in ArcMap 10.1, so i'm just wondering how I need to cast the ILayer to be able to use it? currently there's alot of conflicting information floating around, and I just need to know the right way to handle this. I've looked into GISClient / MapServerLayer / AGSFeatureLayer ... but having trouble determining from the ILayer the "LayerType" i.e. if its from the server... / feature service layer.... any point in the right direction would be great.. as i'm new to this stuff.. I know its possible to consume it all through REST and geoJSON, but I'm assuming ESRI has a better way in ArcObjects to do this for me rather than me having to manually consume it all.. Tomas
... View more
04-17-2013
04:47 PM
|
0
|
2
|
870
|
POST
|
my solution:
IArea pArea = (IArea)m_poly;
//because labels don't show on anti-clockwise drawn polygons (negative area)
//check the area and then reverse the order of points if it is negative..
if (pArea.Area < 0)
{
ESRI.ArcGIS.Geometry.Polygon m_poly_reverse = new PolygonClass();
m_poly_reverse.AddPoint(m_poly.Point[0]);
for (int i = 1; i < m_poly.PointCount; i++)
{
m_poly_reverse.AddPoint(m_poly.Point[m_poly.PointCount-1-i]);
}
}
... View more
02-19-2013
08:35 PM
|
0
|
0
|
276
|
POST
|
ok i've figured out whats happening... the polygon that is drawn in a "left hand" direction gives a 'negative' Area and in return won't label... i.e. something funny is happening how do I reverse the area if a user draws in a reverse direction ? (basically inverting it???)
... View more
10-18-2012
04:27 PM
|
0
|
0
|
276
|
POST
|
Hi I'm using Arcgis Engine to create my geometry into one of my featureLayer's IFeatureClass m_featureClass = featureLayer.FeatureClass;
IFeature feature = m_featureClass.CreateFeature();
feature.Shape = geometry; // this is an IGeometry
feature.Store(); that works fine for Point and Line Class, and the labels update perfectly in the map, but when writing a Polygon the feature stores and displays, but however is missing the Label... am i missing something special I should be doing for the Polygon's ? I tried to turn on and off labels in ArcMap in the mxd.. but the labels are still not showing up for those specific Polygon's I draw with my arcGIS engine tool.... I've also tried starting an Edit Session, and stopping an Edit Session when storing the feature (makes no difference)... and i've tried refresh(), partialRefresh(), and Invalidate() to get them to draw... any help would be greatly appreciated 🙂 Tomas
... View more
10-09-2012
08:01 PM
|
0
|
5
|
597
|
POST
|
yeah i was using the ArcGIS templates for command and tools... ok thanks for that... got it working by casting the m_hookHelper into IHookHelper2.. m_hookHelper2 = (IHookHelper2)m_hookHelper; seems to grab the snapping extension now 🙂 will post back if i have any more issues...
... View more
10-01-2012
05:26 PM
|
0
|
0
|
454
|
POST
|
Hi, I'm kindof new to ArcObjects development but i'm working in the ArcGIS Engine environment (C#.net) and trying to create a custom tool with snapping. currently having a problem getting the snapping extension.. in the documentation it says to use IHookHelper2 -> however I don't seem to be able to CAST the hook into the IHookHelper2.. comes back with a null... m_hookHelper2 = (IHookHelper2)hook; <- does not work... I also tried to get the IApplication / mapDocument from the hook... which also did not work 😞 (this is the documentation code..... need to know where / how to get the m_hookHelper2) [C#] IExtensionManager extensionManager = m_hookHelper2.ExtensionManager; if (extensionManager != null) { UID guid = new UIDClass(); guid.Value = "{E07B4C52-C894-4558-B8D4-D4050018D1DA}"; //Snapping extension. IExtension extension = extensionManager.FindExtension(guid); m_SnappingEnvironment = extension as ISnappingEnvironment; }
... View more
09-26-2012
06:51 PM
|
0
|
2
|
1749
|
Title | Kudos | Posted |
---|---|---|
1 | 06-27-2015 05:16 PM | |
1 | 07-29-2015 12:20 AM |
Online Status |
Offline
|
Date Last Visited |
06-03-2021
01:28 AM
|