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
|
296
|
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
|
2147
|
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
|
532
|
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
|
532
|
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
|
532
|
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
|
3376
|
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
|
487
|
POST
|
Thanks for both tips! I'll investigate and report back...
... View more
01-27-2013
08:13 PM
|
0
|
0
|
170
|
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
|
1532
|
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
|
426
|
POST
|
Hi Robert, Thanks for your thoughts on this! 1. Open a web browser and type in the address http://yourarcgisservername/arcgis/rest/ and then go to the map service in question click on the link for "ArcGIS JavaScript" and see if the symbology is correct there. It is. I suspect Odoe was correct - I'm getting to the point where I can't see any other obvious reason why they may not work. 2. For the querying part ensure that you shape and id fields are not hidden in the map services MXD. All fields are turned on. Thanks again, Roland.
... View more
07-29-2010
12:48 PM
|
0
|
0
|
426
|
POST
|
Is your ArcGIS Server version 10? Using a FeatureLayer, you can only get symbology back from AGS10. I had this issue when I started using FeatureLayer's before I upgraded my server. It isn't - see my original post. Thanks; that answers my original query!
... View more
07-28-2010
01:05 PM
|
0
|
0
|
426
|
POST
|
Does your symbology is part of a graphic layer or is it part of a base map? If a basemap as a wrong symbology, then I believe it is a problem with the rest service itself. Maybe you can check the appearance of the images that are queried to the server with a tool like firebug. Thanks for your thoughts. I'm using Desktop 9.3.1, so it's not a basemap. Not sure what you mean by graphic layer? I did make some progress, just by guessing settings. At the moment, if I choose layer type="dynamic" and set the url to the service, I can get the symbology but can't query it. If I choose layer type="feature" and set the url to one of the layers, then I can query it by clicking on it, but its appearance is just black. This does make some sense to me, as the latter is presumably rendered client-side - but I could do with better documentation to try and work this out. Any clues where I should be looking for more info on these settings? This new arcgis.com is nearly as confusing as the main ESRI site!
... View more
07-27-2010
02:16 PM
|
0
|
0
|
426
|
POST
|
Hi, This might well be a schoolboy error; apologies if so! I'm doing some testing with beta 2; just seeing what you can do really... it looks pretty impressive, but at the moment all my layers are coming out black - lines at 1 point thickness; points are about 18 point in size. The layers I'm loading in are from our ArcGIS Server, which is still on 9.3.1. The services have all manner of garish symbologies applied to them, and they seem to still work properly in all our 9.3.1 apps, some of which use Flex. So is there a particular reason why the symbologies aren't carrying across? Is it just because I'm trying to operate from the two different versions? Any thoughts on what the solution might be? Thanks! Roland.
... View more
07-23-2010
08:50 AM
|
0
|
8
|
2441
|
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|