POST
|
Thank you! Problem solved setting up a webstyle group.
... View more
11-30-2021
12:03 PM
|
1
|
0
|
1940
|
POST
|
Thanks for the prompt reply. I dont have the rights. I will check with the admins. Is that possible instead to use the default ESRI symbol for turbines?
... View more
11-29-2021
02:00 PM
|
0
|
3
|
1949
|
POST
|
Hi @RussRoberts I know that it is old but I still have the issue in 2021! I’ve followed the steps in your blog, but in the scene viewer I can only see the basic icons.It’s possible to use at least the ESRI 3D symbol for the turbines? I’m using portal. Thanks in advance,
... View more
11-29-2021
01:03 PM
|
0
|
5
|
1953
|
POST
|
Hello Mark, Thank you, after your tips i figure it out the isse with listing all fcs. For the ouput I had to os.path.basename and splitext to get the fc names and then os.path.join to generate the full output. Cheers,
... View more
10-27-2020
02:48 PM
|
0
|
0
|
3121
|
POST
|
Hello, thanks for your reply. I "cleaned" the code, but still not working. Still starts failing at fcList . Only the features from one dataset are being listed.For the second dataset fcList is returning "None". If I print dataset or datasetList, i can see the 2 datasets listed. Then in the arcpy.CopyFeatures its try to write a file with shapefile extension, of course an error. import arcpy
arcpy.env.workspace = r"C:\Trials\NPD_FactMapsData_v3_0_2.gdb"
OutputFGDB = r"C:\Trials\New File Geodatabase.gdb"
datasetList = arcpy.ListDatasets()
for dataset in datasetList:
arcpy.env.workspace = dataset
fcList = arcpy.ListFeatureClasses()
for fc in fcList:
arcpy.CopyFeatures_management(fc, OutputFGDB)
... View more
10-24-2020
04:50 PM
|
0
|
1
|
3121
|
POST
|
Hello, I'm trying to write a code to copy the feature classes inside of feature datasets. I'm having two issues. I have 2 feature datasets, but when I do the "print(fcList)" , seems like only the features one dataset are being listed. The second one is that the tool stucks at the arcpy.CopyFeatures Here below my code: Thanks in advance for any tip. import arcpy
from arcpy import env
env.workspace = r'C:/Trials/NPD_FactMapsData_v3_0_2.gdb'
# Set local variables
OutputFGDB = r'C:/Trials/New File Geodatabase.gdb'
#env.workspace = arcpy.GetParameterAsText(0)
datasetList = arcpy.ListDatasets('*','Feature')
try:
for dataset in datasetList:
env.workspace = dataset
fcList = arcpy.ListFeatureClasses()
print (fcList)
for fc in fcList:
print('copying...')
arcpy.CopyFeatures_management(fc,OutputFGDB)
print("copy finished")
except:
# Report if there was an error
arcpy.AddError("Could not copy feature classes")
print ("Could not copy feature classes")
#print arcpy.GetMessages()
... View more
10-23-2020
02:40 PM
|
0
|
5
|
3242
|
POST
|
Hello @Diane, My widget was working fine with Flex 3.6 and AGS 10.2 for a long time. But then, when we updated to AGS 10.6 I started to have this error messagem. My guessing is that something in the ESRI library must had changed. Good Luck, DK
... View more
11-01-2019
02:29 AM
|
0
|
2
|
2342
|
POST
|
Hello Matshopp, Do you mind to share you code? I'm trying also to implement this function. Regards, Dilson
... View more
06-15-2017
10:10 AM
|
0
|
0
|
570
|
POST
|
Question solved,I was able to create my own version of the widget, working under 3.6.
... View more
06-13-2017
03:25 AM
|
0
|
0
|
282
|
POST
|
Question solved, I was totally misunderstanding the concept between a sample and passing into a widget format. I just had to remove the class esr:map and voila, the Rotate Wheel interacts with the my WebGIS application.
... View more
06-13-2017
03:24 AM
|
0
|
0
|
1097
|
POST
|
Question solved, I was totally misunderstanding the concept between a sample and passing into a widget format. I just had to remove the class esr:map and voila, the Rotate Wheel interacts with the my WebGIS application.
... View more
06-13-2017
03:24 AM
|
0
|
0
|
602
|
POST
|
I almost there. I managed to implement the sample into a widget! By the way, the tool is not interacting with the map. I can rotate the "wheel" , I can click on "N" to center the weehl. But nothing happens in the map. I suspect that it's because I've ommitted the following line from the sample (I didn't figure out how to implement this part into the widget): <esri:center> <esri:MapPoint x="-10051125" y="4669530"/> </esri:center> <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/> </esri:Map> Here is my code : <?xml version="1.0" encoding="utf-8"?> <viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:esri="http://www.esri.com/2008/ags" xmlns:viewer="com.esri.viewer.*" xmlns:components="widgets.RotateMap.components.*"> <fx:Script> <![CDATA[ import com.esri.ags.Map; import com.esri.ags.geometry.MapPoint; import com.esri.viewer.AppEvent; import com.esri.viewer.utils.LocalizationUtil; import mx.collections.ArrayCollection; import mx.events.FlexEvent; ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <esri:Map id="map" crosshairVisible="true" level="17" middleButtonRotationEnabled="true" wrapAround180="true" zoomSliderVisible="false"> </esri:Map> <components:RotationWheel id="wheel" width="75" height="75" left="20" top="20" change="map.rotateTo(wheel.mapRotation, wheel.mapRotation == 0)" mapRotation="{map.mapRotation}" skinClass="widgets.RotateMap.skins.RotationWheelSkin"/> </viewer:BaseWidget> Any tip on this issue? Thanks in advance Dilson
... View more
06-09-2017
09:33 AM
|
0
|
1
|
1097
|
POST
|
Hi Bjorn I was able to able to migrate the sample to a compiled widget. By the way, the tool is not interacting with the map. I can rotate the "wheel" , I can click on "N" to center the weehl. But nothing happens in the map. I suspect that it's because I've ommitted the following line from the sample (I didn't figure out how to implement this part in to the widget): <esri:center> <esri:MapPoint x="-10051125" y="4669530"/> </esri:center> <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/> </esri:Map> Here is my code : <?xml version="1.0" encoding="utf-8"?> <viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:esri="http://www.esri.com/2008/ags" xmlns:viewer="com.esri.viewer.*" xmlns:components="widgets.RotateMap.components.*"> <fx:Script> <![CDATA[ import com.esri.ags.Map; import com.esri.ags.geometry.MapPoint; import com.esri.viewer.AppEvent; import com.esri.viewer.utils.LocalizationUtil; import mx.collections.ArrayCollection; import mx.events.FlexEvent; ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <esri:Map id="map" crosshairVisible="true" level="17" middleButtonRotationEnabled="true" wrapAround180="true" zoomSliderVisible="false"> </esri:Map> <components:RotationWheel id="wheel" width="75" height="75" left="20" top="20" change="map.rotateTo(wheel.mapRotation, wheel.mapRotation == 0)" mapRotation="{map.mapRotation}" skinClass="widgets.RotateMap.skins.RotationWheelSkin"/> </viewer:BaseWidget> Any tip on this issue? Thanks in advance Dilson
... View more
06-09-2017
09:31 AM
|
0
|
1
|
602
|
POST
|
Hello Sorry, I posted the code in wrong why, I was trying to directly use the sample example application as widget structure. Below is me code for the widget that 'm trying to do. By the way I getting 2 errors: Syntax error 1084: expecting rightbrace before end of program (below) </fx:Script> "1131: Classes must not be nested." (below) public class RotationWheel extends SkinnableComponent <?xml version="1.0" encoding="utf-8"?> <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:esri="http://www.esri.com/2008/ags" xmlns:RotateMap="widgets.RotateMap"> <fx:Script> <![CDATA[ import com.esri.ags.Map; import com.esri.viewer.AppEvent; import com.esri.viewer.utils.LocalizationUtil; import flash.events.Event; import flash.events.MouseEvent; import flash.geom.Point; import flash.geom.Vector3D; import mx.binding.utils.BindingUtils; import mx.binding.utils.ChangeWatcher; import mx.core.UIComponent; import spark.components.Group; import spark.components.supportClasses.SkinnableComponent; [Event(name="change", type="flash.events.Event")] [SkinState("up")] [SkinState("overNorth")] [SkinState("downNorth")] [SkinState("overWheel")] [SkinState("downWheel")] [SkinState("disabled")] public class RotationWheel extends SkinnableComponent { public static const DEG_PER_RAD:Number = 180 / Math.PI; public function RotationWheel() { super(); buttonMode = true; addEventListener(MouseEvent.MOUSE_OVER, mouseOverOutHandler); addEventListener(MouseEvent.MOUSE_OUT, mouseOverOutHandler); addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); } private var m_globalWheelCenter:Vector3D = new Vector3D(); private var m_originVector:Vector3D = new Vector3D(); private var m_wheelCenterVector:Vector3D = new Vector3D(); private var m_originMapRotation:Number = 0; private var m_overWheel:Boolean; private var m_mouseOverNorth:Boolean; private var m_mouseDown:Boolean; [SkinPart(required="false")] public var wheel:Group; [SkinPart(required="false")] public var north:UIComponent; private var m_mapRotation:Number = 0; [Bindable("mapRotationChanged")] public function get mapRotation():Number { return m_mapRotation; } public function set mapRotation(value:Number):void { if (m_mapRotation != value) { m_mapRotation = value; if (skin) { skin.invalidateProperties(); } dispatchEvent(new Event("mapRotationChanged")); } } private var m_map:Map; private var m_mapRotationWatcher:ChangeWatcher; public function get map():Map { return m_map; } public function set map(value:Map):void { if (m_map !== value) { if (m_mapRotationWatcher) { m_mapRotationWatcher.unwatch(); } m_map = value; if (m_map) { mapRotation = m_map.mapRotation; if (m_mapRotationWatcher) { m_mapRotationWatcher.reset(m_map); } else { m_mapRotationWatcher = BindingUtils.bindProperty(this, "mapRotation", m_map, "mapRotation"); } } } } override protected function getCurrentSkinState():String { var state:String = "up"; if (m_overWheel) { state = m_mouseDown ? "down" : "over"; state += "Wheel"; } else if (m_mouseOverNorth) { state = m_mouseDown ? "down" : "over"; state += "North"; } return state; } private function stop():void { stage.removeEventListener(Event.ENTER_FRAME, enterFrameHandler); stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); m_mouseDown = false; } private function mouseOverOutHandler(event:MouseEvent):void { if (!m_mouseDown) { m_overWheel = m_mouseOverNorth = false; if (event.target === north) { m_mouseOverNorth = true; } else { m_overWheel = true; } invalidateSkinState(); } } private function mouseDownHandler(event:MouseEvent):void { var globalCenter:Point = wheel.localToGlobal(new Point(wheel.transformX, wheel.transformY)); m_globalWheelCenter.setTo(globalCenter.x, globalCenter.y, 0.0); m_wheelCenterVector.setTo(m_globalWheelCenter.x, m_globalWheelCenter.y, 0.0); m_originVector.setTo(event.stageX, event.stageY, 0.0); m_originVector = m_originVector.subtract(m_wheelCenterVector); m_originVector.normalize(); m_originMapRotation = m_mapRotation; stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler); stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); m_mouseDown = true; invalidateSkinState(); } private function enterFrameHandler(event:Event):void { var mousePosition:Point = wheel.localToGlobal(new Point(wheel.mouseX, wheel.mouseY)); var newVector:Vector3D = new Vector3D(mousePosition.x, mousePosition.y); newVector = newVector.subtract(m_wheelCenterVector); newVector.normalize(); var n:Vector3D = m_originVector.crossProduct(newVector); var newAngle:Number = Vector3D.angleBetween(m_originVector, newVector) * DEG_PER_RAD; if (n.z < 0) { newAngle = -newAngle; } newAngle += m_originMapRotation; if (isNaN(newAngle)) { newAngle = 0; } if (Math.abs(mapRotation - newAngle) > 1) { mapRotation = newAngle; dispatchEvent(new Event(Event.CHANGE)); } } private function mouseUpHandler(event:MouseEvent):void { stop(); invalidateSkinState(); if (m_mouseOverNorth) { if (Math.abs(mapRotation - m_originMapRotation) < 3) { mapRotation = 0; dispatchEvent(new Event(Event.CHANGE)); } } ]]> </fx:Script> <s:Group enabled="{map.loaded}" includeInLayout="{panwheelItem.toolVisible}" layoutDirection="ltr" visible="{panwheelItem.toolVisible}"> <s:Button id="wheel" width="75" height="75" left="20" top="20" change="map.rotateTo(wheel.mapRotation, wheel.mapRotation == 0)" mapRotation="{map.mapRotation}" skinClass="widgets.RotateMap.RotationWheelSkin"/> </s:Group> </s:Group>
... View more
06-09-2017
07:51 AM
|
0
|
2
|
1097
|
Title | Kudos | Posted |
---|---|---|
1 | 11-30-2021 12:03 PM |
Online Status |
Offline
|
Date Last Visited |
11-30-2021
01:51 PM
|