POST
|
Answer here : http://forums.arcgis.com/threads/47767-Drawing-a-line-with-arrow-in-web-application-with-C-and-silverlight (duplicate) Sorry i posted it in the wrong section and i couldn't delete it
... View more
01-17-2012
03:59 AM
|
0
|
0
|
152
|
POST
|
Is there any way to use google maps by silverlight with esri?
... View more
01-16-2012
11:17 PM
|
0
|
1
|
742
|
POST
|
You need either to include the �??ExtendedSymbols�?? project in your project or just to reference the ExtendedSymbols dll (others projects are not useful) Then you can create a line symbol that has an arrow at the end with XAML code like: <extendedSymbols:ExtendedLineSymbol x:Key="arrowLineSymbol" Fill="Red" >
<extendedSymbols:ExtendedLineSymbol.GeometryTransformer>
<extendedSymbols:ArrowPatternTransformer AtEnd="True" />
</extendedSymbols:ExtendedLineSymbol.GeometryTransformer>
</extendedSymbols:ExtendedLineSymbol>
(with xmlns:extendedSymbols="clr-namespace:ExtendedSymbols;assembly=ExtendedSymbols") Then the symbol can be used in replacement of any line symbol. For example:
<esri:GraphicsLayer>
<esri:GraphicsLayer.Renderer>
<esri:SimpleRenderer Symbol="{StaticResource arrowLineSymbol}"/>
</esri:GraphicsLayer.Renderer>
<esri:GraphicsLayer.Graphics >
<esri:Graphic>
<esri:Polyline >
<esri:Polyline.Paths>
<esri:PointCollection>
<esri:MapPoint X="0" Y="51.399" />
<esri:MapPoint X="2.637" Y="48.865" />
<esri:MapPoint X="12.568" Y="41.706" />
<esri:MapPoint X="13.447" Y="52.483" />
<esri:MapPoint X="21.357" Y="52.160" />
<esri:MapPoint X="30.322" Y="59.845" />
</esri:PointCollection>
</esri:Polyline.Paths>
</esri:Polyline>
</esri:Graphic>
</esri:GraphicsLayer.Graphics>
</esri:GraphicsLayer> Thank you, it works.
... View more
01-16-2012
05:50 AM
|
0
|
0
|
471
|
POST
|
This sample is done for you. thanx for your help,but i already found this example and trying to find how to use it using points coordinates not by the event handled by the user ,i will be grateful if you can help me i need to draw lines given their coordinated and i need to keep them on the graphic layer.
... View more
01-16-2012
02:56 AM
|
0
|
0
|
471
|
POST
|
Is there any way to draw a line with arrow at the end or the middle in a web application using C# and Silverlight?
... View more
01-14-2012
11:47 PM
|
0
|
6
|
1446
|
POST
|
Is there any way to draw a line with arrow at the end or the middle in a web application using C# and Silverlight?
... View more
01-14-2012
11:44 PM
|
0
|
2
|
278
|
POST
|
You should be checking the result of the call to Initialize to make sure the license is checked out and exit the program if it is not. Also, you need to pass the full path to open the workspace and not just the file name. For the file name i'm putting it in the Debug folder but for the checking of the result of the call to Initialize i didn't understand it and don't know what to write.
... View more
10-31-2011
06:01 AM
|
0
|
0
|
768
|
POST
|
You need to check out a license after the call to Bind and before using any ArcObjects. I made some modifications on the code and it also give me this error : System.Runtime.InteropServices.COMException was unhandled Message=Exception from HRESULT: 0x80040228 Source=ESRI.ArcGIS.Geodatabase ErrorCode=-2147220952 StackTrace: at ESRI.ArcGIS.Geodatabase.IWorkspaceFactory.OpenFromFile(String fileName, Int32 hWnd) at DesktopConsoleApplication1.Program.AccessWorkspaceFromPath(String path) in ..\DesktopConsoleApplication1\DesktopConsoleApplication1\Program.cs:line 27 at DesktopConsoleApplication1.Program.Main(String[] args) in ..\DesktopConsoleApplication1\DesktopConsoleApplication1\Program.cs:line 18 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: The modified code is as below : using System;
using ESRI.ArcGIS.Geodatabase;
using System.IO;
using System.Windows.Forms;
using ESRI.ArcGIS.esriSystem;
namespace DesktopConsoleApplication1
{
class Program
{
[STAThread()]
static void Main(string[] args)
{
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
IAoInitialize aoInit = new AoInitializeClass();
aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);
IWorkspace iws;
iws = AccessWorkspaceFromPath("Test.mdb");
aoInit.Shutdown();
}
public static IWorkspace AccessWorkspaceFromPath(String path)
{
if (File.Exists(path)){
Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.AccessWorkspaceFactory");
IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance
(factoryType);
IWorkspace workspace = workspaceFactory.OpenFromFile(path, 0);
return workspace;
}
return null;
}
}
}
... View more
10-31-2011
05:33 AM
|
0
|
0
|
768
|
POST
|
Not only do you have to bind to a product runtime you also have to check out a license. This should occur before you use any ArcObjects. In your code you are declaring an IWorkspace instance before the call to Bind. You need to move the call to Bind and add the code to check out the license. Also, you are trying to open an Access personal geodatabase but your code is creating an instance of an ArcInfoWorkspaceFactory. You need to be using an AccessWorkspaceFactory. The workspace factory is a singleton object. You shouldn't be using New to create the instance. Instead, you should be using the Activator class. If you mean that the code be like this using System;
using System.Collections.Generic;
using System.Text;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geodatabase;
namespace DesktopConsoleApplication1
{
class Program
{
[STAThread()]
static void Main(string[] args)
{
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
IWorkspace iws;
iws = AccessWorkspaceFromPath(@"C:\GD\Test.mdb");
}
public static IWorkspace AccessWorkspaceFromPath(String path)
{
Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.AccessWorkspaceFactory");
IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance
(factoryType);
IWorkspace workspace = workspaceFactory.OpenFromFile(path, 0);
return workspace;
}
}
} ,i also try it before and it gave me this error: System.Runtime.InteropServices.COMException was unhandled Message=Exception from HRESULT: 0x80040213 Source=ESRI.ArcGIS.Geodatabase ErrorCode=-2147220973 StackTrace: at ESRI.ArcGIS.Geodatabase.IWorkspaceFactory.OpenFromFile(String fileName, Int32 hWnd) at DesktopConsoleApplication1.Program.AccessWorkspaceFromPath(String path) in ..\DesktopConsoleApplication1\Program.cs:line 22 at DesktopConsoleApplication1.Program.Main(String[] args) in ..\DesktopConsoleApplication1\DesktopConsoleApplication1\Program.cs:line 15 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: .
... View more
10-30-2011
12:03 AM
|
0
|
0
|
768
|
POST
|
I'm getting started with ArcObject and i'm trying to build a console application that reads mdb file and shows it's contents but i have been working in it for a long time and i don't know what is the problem that i'm facing i'm using -windows server 2008 sp2 -VS 2010 C# -ArcGis 10.0 licence Type:ArcInfo -ArcSDK 10 My code is as following
using System;
using System.Collections.Generic;
using System.Text;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geodatabase;
namespace DesktopConsoleApplication1
{
class Program
{
[STAThread()]
static void Main(string[] args)
{
IWorkspace iws;
iws = AccessWorkspaceFromPath(@"C:\GD\Test.mdb");
}
public static IWorkspace AccessWorkspaceFromPath(String path)
{
//ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesFile.ArcInfoWorkspaceFactoryClass();
// Get FeatureClass to be set as datasource
IWorkspace workspace = workspaceFactory.OpenFromFile(path, 0);
return workspace;
}
}
}
when i us this code it give this error : Retrieving the COM class factory for component with CLSID {1D887452-D9F2-11D1-AA81-00C04FA33A15} failed due to the following error: 80040111. and when activating this line ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop); it gives me this error : Error HRESULT E_FAIL has been returned from a call to a COM component. Please any one can help me to solve this problem. Thank you.
... View more
10-27-2011
01:56 AM
|
0
|
6
|
5818
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|