POST
|
Hi Akos Halmai, Thanks for your explanation, will follow you advice and update the result.
... View more
10-07-2016
01:57 AM
|
0
|
0
|
501
|
POST
|
Hi, My polygon has several interior rings, and I want to move all vertices in these interior rings. I define the list of interior ring points into a list of IPointCollection, but when I try to add point to an IPointCollection, I got the "Index was out of range. Must be non-negative and less than the size of the collection" error. My code as follows: Dim polygon As IPolygon4 = TryCast(mFeature.Shape, IPolygon4)
Dim exteriorRingGeometryBag As IGeometryBag = polygon.ExteriorRingBag
Dim exteriorRingGeometryCollection As IGeometryCollection = TryCast(exteriorRingGeometryBag, IGeometryCollection)
Dim inRing As List(Of IPointCollection) = New List(Of IPointCollection)
For i = 0 To exteriorRingGeometryCollection.GeometryCount - 1
Dim exteriorRingGeometry As IGeometry = exteriorRingGeometryCollection.Geometry(i)
Dim exteriorRingPointCollection As IPointCollection = TryCast(exteriorRingGeometry, IPointCollection)
Dim interiorRingGeometryBag As IGeometryBag = polygon.InteriorRingBag(TryCast(exteriorRingGeometry, IRing))
Dim interiorRingGeometryCollection As IGeometryCollection = TryCast(interiorRingGeometryBag, IGeometryCollection)
For k = 0 To interiorRingGeometryCollection.GeometryCount - 1
Dim InteriorRingGeometry As IGeometry = interiorRingGeometryCollection.Geometry(k)
Dim InteriorRingPointCollection As IPointCollection = TryCast(InteriorRingGeometry, IPointCollection)
For m = 0 To InteriorRingPointCollection.PointCount - 1
Dim pp As IPoint = InteriorRingPointCollection.Point(m)
pp.X = Round(pp.X, 2)
pp.Y = Round(pp.Y, 2)
inRing(k).AddPoint(pp) ' I got error this line
Next
Next
... View more
10-05-2016
08:36 PM
|
0
|
2
|
1294
|
POST
|
Hi Owen, I know what is up, in the text I replace in the init.js missing a double quotation marks, now it works, thanks for your reminding.
... View more
03-18-2015
06:01 PM
|
0
|
1
|
1175
|
POST
|
Hi Owen, Thanks for the fast reply. I just followed the install.htm and changed the Configuration for normal build. I found one thing, it seems the only thing not work is the code for the init.js. If I use <script type="text/javascript" src="http://js.arcgis.com/3.13/init.js"></script> instead of <script type="text/javascript" src="http://localhost/arcgis_js_api/library/3.12/3.12/init.js"></script> and all others use local url, it works.
... View more
03-17-2015
11:08 PM
|
0
|
0
|
1175
|
POST
|
Hi all, I follow the Install notes for the ArcGIS API for JavaScript™ (version 3.12) to install the API to my local (ArcGIS server). The following steps had already been performed: (1) the arcgis_js_api folder is put under C:\inetpub\wwwroot. (2) add the new application arcgis_js_api in IIS manager default web site. (3) add init.js in default web site default document. (4) restart IIS manager default web site (5) modify the service directories as in the following picture: I can access the api through browser: The sample html is : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Simple Map</title> <link rel="stylesheet" type="text/css" href="http://localhost/arcgis_js_api/library/3.12/3.12/dijit/themes/tundra/tundra.css"/> <link rel="stylesheet" type="text/css" href="http://localhost/arcgis_js_api/library/3.12/3.12/esri/css/esri.css" /> <script type="text/javascript" src="http://localhost/arcgis_js_api/library/3.12/3.12/init.js"></script> <script type="text/javascript"> dojo.require("esri.map"); function init() { var myMap = new esri.Map("mapDiv"); var myTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer"); myMap.addLayer(myTiledMapServiceLayer); } dojo.addOnLoad(init); </script> </head> <body class="tundra"> <div id="mapDiv" style="width:900px; height:600px; border:1px solid #000;"></div> </body> </html> When I tested this sample html, I always got a page with a blank window. Can anybody tell me what is wrong with my installation of the API for javascript? My pc has the internet access.
... View more
03-17-2015
06:32 PM
|
0
|
4
|
5752
|
POST
|
In my widget, I have a datgrid which get data from sql server. One of the column is string. The values in this column include 2 parts: (1) the first part is a string (2) the last part is a number The following is sample data: JP2001/12-1 JP2001/12-12 JP2001/12-13 JP2001/12-15 JP2001/12-19 JP2001/12-2 JP2001/12-3 JP2001/12-4 JP2001/12-6 JP2001/15-1 JP2001/15-11 JP2001/15-14 JP2001/15-6 JP2001/15-9 The first part like "JP2001/12-", whereas the last part is the number 1,2,3,4,...11,12... In order to sort this column, in my sortCompareFunction, I need to compare the first part at first, if the first part value is the same, then compare the last part number value. The desired sorting result should be: JP2001/12-1 JP2001/12-2 JP2001/12-3 JP2001/12-4 JP2001/12-6 JP2001/12-12 JP2001/12-13 JP2001/12-15 JP2001/12-19 JP2001/15-1 JP2001/15-6 JP2001/15-9 JP2001/15-11 JP2001/15-14 But I failed to find a way to make it work. Any ideas? Thanks.
... View more
03-12-2015
07:53 PM
|
0
|
0
|
3514
|
POST
|
Hi Robert, Yes there is something wrong with my code, I have managed to resolve it. Thanks a lot for the attention.
... View more
01-06-2015
11:01 PM
|
0
|
0
|
363
|
POST
|
Hi everyone, In my flex project, I have 2 widgets: widget 1 - user input searching criteria, and when click "Ok", close widget 1 and open widget 2. widget 2 - use the searching criteria from widget 1 and display the result in a datagrid (from database). I have successfully passed the searching criteria from widget 1 to widget 2 and the datagrid can display data according to different searching criteria in widget 1. but the datagrid cannot select a row or sorting or scrolling. In widget 2 init() function, I add this line: ws.GetData(query);//query is from widget 1 In the function of getting data I use: public function GetData(event:ResultEvent):void { datagrid.dataProvider = null; ws.GetData(query); datagrid.dataProvider = event.result; } The problem is: If I add the line of datagrid.dataProvider = null; The datagrid data will be refresh according to different searching criteria from widget 1, but the datagrid cannot be used properly (cannot select, sort, scroll). If I remove the line of datagrid.dataProvider = null; the datagrid can be used properly. but the data in the datagrid will never be updated according to dfferent searching criteria. It means it always display the first time searching result. How can make it work properly? Thanks in advance.
... View more
01-05-2015
08:39 PM
|
0
|
2
|
4282
|
POST
|
Thank you Anthony for the reply. I have tried the code above. no error but also no picture displayed.
... View more
12-29-2014
07:18 PM
|
0
|
0
|
249
|
POST
|
Dear all, I am trying to display the images in flex widget got from JSON. All works except the displaying of the images in the widget. I have 8 image in design mode of the widget, the source will be assigned at runtime when get the data from JSON. The images will be assigned one by one from image1. I use the same set of JSON data to test. The strange thing is every time the images displayed in the widget is different, for example, sometimes it displays all the 8 images, sometimes it displays image2, image4, image7, sometimes it displays image1, image2, image5. The source code I use: private var value0:String;//id private var value1:String;// type private var value2:String;// image url var request:URLRequest=new URLRequest(); request.url=getUrl; request.requestHeaders=[new URLRequestHeader("Content-Type", "application/json")]; request.method=URLRequestMethod.GET; var loader:URLLoader=new URLLoader(); loader.addEventListener(Event.COMPLETE, receive); loader.load(request); protected function receive(event:Event):void { var myResults:Array= com.adobe.serialization.json.JSON.decode(event.target.data); var i:int; for (i=0;i<myResults.length; i++){ value0 = myResults.goods_id; value1 = myResults.goods_type; value2 = myResults.image_url; if (!image1.source){ image1.source = value2; }else if (!image2.source){ image2.source = value2; }else if (!image3.source){ image3.source = value2; }else if (!image4.source){ image4.source = value2; }else if (!image5.source){ image5.source = value2; }else if (!image6.source){ image6.source = value2; }else if (!image7.source){ image7.source = value2; }else if (!image8.source){ image8.source = value2; } } Anybody has experience on it? Please advise me, thank you.
... View more
12-22-2014
06:51 PM
|
0
|
2
|
4259
|
POST
|
Thank Anthony, I have already set the width and height according to page you gave. But I need to change every time because in my widget I need to load several images (the number of images will change each time). I am thinking another approach, which use a auto scrollbar to the widget, but also cannot get what I want.
... View more
12-11-2014
08:09 PM
|
0
|
2
|
430
|
POST
|
Hi Anthony, Thanks a lot for the answer, seems new version is easier, but after I update the code, the template size never change. should I change the basewidget also? EDIT: After I drag the template I can change the size. I use setResize at init(), is should resize when loading the template right?
... View more
12-09-2014
08:05 PM
|
0
|
4
|
430
|
POST
|
Greetings, In my flex viewer, I need to change the template size at runtime. Have found the previous thread but cannot ask question there. I refer to the following link: http://forums.esri.com/Thread.asp?c=158&f=2421&t=279252 I follow the steps advised by Robert as follows: (1) added the line in IWidgetTemplate.as function setResize(value1:Number, value2:Number):void; (2) added the following code in the WidgetTemplate.as public function setResize(nHeight:Number, nWidth:Number):void { this.height = nHeight; wCanvas.height = nHeight; this.width = nWidth; wCanvas.width = nWidth - 40; } But I got the error: access of undefined property wCanvas. (3) add the following in mx:State in the mxml which I want to resize the template. <mx:SetProperty target="{wCanvas}" name="height" value="{height}"/> <mx:SetProperty target="{wCanvas}" name="width" value="{width - 40}"/> But wherever I put the mx:state, It always return me: <mx:state> is not allowed here. I am not sure whether step (3) is correct, and where should I define wCanvas? or should I use wTemplate instead of wCanvas? Or is it because the version is different (I use version 3.6). Any idea? advice is appreciated.
... View more
12-09-2014
12:23 AM
|
0
|
6
|
3553
|
POST
|
Hi Robert, I have already got the issue fixed, thanks for the kind help.
... View more
12-02-2014
10:27 PM
|
0
|
0
|
311
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|