POST
|
Hi both, Sorry for not responding sooner - I've only just worked out how to reply (the reply button doesn't work!) I actually opened this up as a support ticket with Esri, and they have filed a couple of bugs/enhancements relating to it. As you say, it looks as though this interface isn't actually supported for Python. Alexander - thanks, well spotted! I was assuming that any output that's normally written to the screen by Python would be automatically passed back, but I can see that doesn't entirely make sense... Duncan - what I'm trying to do is dependent on having information pass from Python to VB.net within the same ArcMap session (for example, so I can tell which Data Driven Page is currently in view). I think I'm right in saying that all the methodologies described at your first link launch a new ArcMap session? Or am I missing something obvious? Thanks for your help! Roland.
... View more
03-11-2016
09:15 AM
|
0
|
1
|
8
|
POST
|
Hi, Has anyone figured out how to correctly use Python with the IESRIScriptEngine in .NET? The documentation isn't particularly detailed. Through guesswork, I've come up with this: Dim pointer(1) As IntPtr pointer(0) = Runtime.InteropServices.Marshal.AllocHGlobal(4) Dim engine As IESRIScriptEngine = New ESRIScriptEngine With engine .Language = "python" .AddCode("import arcpy") .AddCode("mxd = arcpy.mapping.MapDocument(""CURRENT"")") .AddCode("mxd.dataDrivenPages.currentPageID = " & id) .Run("", pointer) End With This code runs if you encapsulate it in a Try/Catch block, but the pointer isn't working, which means it throws an error every time it runs. Not a major problem in this instance, but it means I can't get any variables passed back from the script. Any ideas? Thanks! Roland.
... View more
02-02-2016
08:54 AM
|
0
|
4
|
1859
|
POST
|
Hi Noah, Thanks for this it was really helpful. It looks as though there are a few inconsistencies at this stage. Most notably, it seems that esriConfig.request.proxyUrl needs to be defined, but left as an empty string. It seems the new API treats protocols differently too - all my URLs started previously with "//" to be protocol agnostic, but the urlPrefix now needs to either define the protocol in full or ignore it altogether (i.e. start with the subdomain / domain / server URL). The code below kind of works for me... it's not actually showing anything on the map yet, but it does seem to download the data successfully. Thanks again! Roland. var map, view; require([ "esri/Map", "esri/views/SceneView", "esri/config", "esri/core/urlUtils", "esri/layers/FeatureLayer", "dojo/domReady!" ], function( Map, SceneView, esriConfig, urlUtils, FeatureLayer ) { esriConfig.request.proxyUrl = ""; urlUtils.addProxyRule({ urlPrefix : "{...}", proxyUrl : "proxy/proxy.php" }); map = new Map({ basemap : "streets" }); view = new SceneView({ container : "viewDiv", map : map }); overlay = new FeatureLayer("//{...}/MapServer/0"); map.add(overlay); });
... View more
08-12-2015
02:38 PM
|
0
|
0
|
7
|
POST
|
Thanks! I've just tried running with the v3.14 proxy code integrated, but I'm still getting a "token required" error, presumably meaning the proxy isn't being used. Any ideas? If the proxying is due to follow in a future beta then this isn't urgent - I'm just curious to see it in operation! Thanks again, Roland. var map, view; require([ "esri/Map", "esri/views/SceneView", "esri/config", "esri/core/urlUtils", "esri/layers/FeatureLayer", "dojo/domReady!" ], function( Map, SceneView, esriConfig, urlUtils, FeatureLayer ) { esriConfig.request.proxyUrl = "proxy/proxy.php"; urlUtils.addProxyRule({ urlPrefix : "{...}", proxyUrl : "proxy/proxy.php" }); map = new Map({ basemap : "streets" }); view = new SceneView({ container : "viewDiv", map : map }); overlay = new FeatureLayer("{...}/MapServer/0"); map.add(overlay); });
... View more
08-06-2015
02:53 PM
|
0
|
2
|
7
|
POST
|
Hi Kristian, Yes - it's the PHP proxy (see URL above) and I've just ported it across from a working site that uses JSAPI v3.14 (some code snippets below). I'm using the latest version of the proxy code from GitHub. I suspect the problem is that I'm not using the JS v4.0 proxy code correctly, but it's difficult to tell. I couldn't find an equivalent for the urlPrefix statement, which might be key here... Thanks! Roland. >>> define([ 'esri/urlUtils' ], function( urlUtils ) { urlUtils.addProxyRule({ urlPrefix : "{...}", proxyUrl : "proxy/proxy.php" });
... View more
08-06-2015
01:27 PM
|
0
|
4
|
7
|
POST
|
Has anyone figured out how to use the proxy? Right now I've got: var map, view; require([ "esri/Map", "esri/views/SceneView", "esri/config", "esri/layers/FeatureLayer", "dojo/domReady!" ], function( Map, SceneView, esriConfig, ArcGISDynamicLayer, FeatureLayer ) { esriConfig.request.proxyUrl = "proxy/proxy.php"; map = new Map({ basemap : "streets" }); view = new SceneView({ container : "viewDiv", map : map }); overlay = new FeatureLayer("{...}/MapServer/0"); map.add(overlay); }); ... but the proxy is being bypassed. I'm guessing I need to define which URLs get proxied somewhere, and I've played a bit with esri/request, but haven't got anywhere with that either. The only thing that works is using forceProxy=true, and that sends all requests through the proxy. Any thoughts?
... View more
08-05-2015
04:29 PM
|
0
|
6
|
2851
|
POST
|
It looks as though this only currently works in 3D mode, not 2D - is that correct? Thanks!
... View more
08-05-2015
03:51 PM
|
0
|
1
|
8
|
POST
|
Thanks for both tips! I'll investigate and report back...
... View more
01-27-2013
08:13 PM
|
0
|
0
|
3
|
POST
|
Hi, Has anyone got to grips with how the new legend functionality works in Desktop 10.1 using .NET? Specifically, the way it only shows layers which are currently visible on screen? It looks as though it works for the 'Service Layer Credits' dynamic text as well. I'm looking at using something similar and was just wondering what's accessible through ArcObjects. Specifically, what I want to do is have some text appear on the layout when particular layers' features are visible, just like the credits text does. Do I need to write my own code to test whether a layer has features currently visible in the data frame, or is this already exposed somewhere? I'm aware this isn't the most coherent question ever; I suppose more than anything I'm looking for ideas rather than answers. Any thoughts or suggestions gratefully received! Thanks, Roland.
... View more
01-23-2013
05:39 PM
|
0
|
2
|
1365
|
POST
|
An ArcGIS Server 10 layer can include a Renderer in the Drawing Info. e.g. http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0 The Flex API's FeatureLayer will use this by default. If you're using a layer that does not have any Drawing Info, then the default symbology is used. You can set a renderer or symbol on the FeatureLayer since these properties are inherited from GraphicsLayer: http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/GraphicsLayer.html So the practical upshot of this is that while I'm mixing 9.3.1 with 10, if I want to use feature layers I need to specify the symbology using code? Presumably dynamic layers can't be queried? Thanks!
... View more
07-29-2010
04:40 PM
|
0
|
0
|
2
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|