12.07.2015 Views

Developing ArcGIS Engine Applications - Northeast Arc Users Group

Developing ArcGIS Engine Applications - Northeast Arc Users Group

Developing ArcGIS Engine Applications - Northeast Arc Users Group

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Developing</strong> <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> <strong>Applications</strong>ESRI Boston


Introductions• Who I am• Who are you?– ESRI Product Experience– ESRI Product Development Experience– Development Language of choice• Last 12 months• Next 12 months


Agenda• <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> Product• <strong>Arc</strong>hitecture and APIs• Licensing <strong>Applications</strong>• 2D and 3D Controls• Extending Controls• Deployment and Distribution


<strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong>• <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> Developer Kit– The toolkit for building and deploying custom desktop<strong>Arc</strong>Objects-based based solutions (VB 6, .NET, Java, C++)• <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> Runtime– The platform for running cross platform customdesktop solutions built with the <strong>Engine</strong> Developer Kit


<strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> Developer Kit• <strong>Engine</strong> <strong>Arc</strong>Objects support for– COM, .NET, Java, and C++• Developer controls• Developer resources– Help, doc, samples, etc.• <strong>Engine</strong> Runtime for testingProduct for Developers


Types of <strong>Engine</strong> SolutionsStand-alonealoneNon visualEmbeddedapplications


<strong><strong>Arc</strong>GIS</strong> <strong>Arc</strong>hitectureProducts Share <strong>Arc</strong>Objects<strong><strong>Arc</strong>GIS</strong> Desktop<strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong><strong><strong>Arc</strong>GIS</strong> Server


<strong><strong>Arc</strong>GIS</strong> Libraries• All products share libraries• Need to identify which libraries belong to <strong>Engine</strong>


<strong><strong>Arc</strong>GIS</strong> Product Licensing Model• <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> andDesktop are functionallysimilar• Two levels of licensing– Product• <strong>Arc</strong>View, <strong>Arc</strong>Editor and<strong>Arc</strong>Info• <strong>Engine</strong> standard and GDBUpdate– Extension• Spatial, 3D, StreetMap USADesktop <strong>Engine</strong> RuntimeStandard <strong>Arc</strong>View Standard<strong>Engine</strong>Geodatabase<strong>Arc</strong>SDE Edit<strong>Arc</strong>InfoUpdate<strong>Arc</strong>EditorOption3DAnalyst… 3D…Extensions


<strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> Runtime Licensing:Products• All applications must initialize a product licenseat runtime• Use esriSystem::AoInitialize• Product codes available– <strong>Arc</strong>View– <strong>Arc</strong>Editor– <strong>Arc</strong>Info– <strong>Engine</strong>– <strong>Engine</strong>GeoDBPrivatePrivatem_pAoInitializem_pAoInitializeAsAsIAoInitializeIAoInitializePrivatePrivateSubSubForm_Load()Form_Load()SetSetm_pAoInitializem_pAoInitialize==NewNewAoInitializeAoInitializem_pAoInitialize.Initializem_pAoInitialize.InitializeesriLicenseProductCode<strong>Engine</strong>esriLicenseProductCode<strong>Engine</strong>EndEndSubSubPrivatePrivateSubSubForm_Unload(CancelForm_Unload(CancelAsAsInteger)Integer)m_pAoInitialize.Shutdownm_pAoInitialize.ShutdownEndEndSubSub


<strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> Runtime Licensing:Extensions• <strong>Applications</strong> can also initialize an extensionlicense• Extension codes available– 3DAnalyst, SpatialAnalyst, Network, etcPrivatePrivatem_pAoInitializem_pAoInitializeAsAsIAoInitializeIAoInitializePrivatePrivateSubSubForm_Load()Form_Load()SetSetm_pAoInitializem_pAoInitialize==NewNewAoInitializeAoInitializem_pAoInitialize.Initializem_pAoInitialize.InitializeesriLicenseProductCode<strong>Engine</strong>esriLicenseProductCode<strong>Engine</strong>m_pAoInitialize.CheckOutExtensionm_pAoInitialize.CheckOutExtensionesriLicenseExtensionCode3DAnalystesriLicenseExtensionCode3DAnalystEndEndSubSubPrivatePrivateSubSubForm_Unload(CancelForm_Unload(CancelAsAsInteger)Integer)m_pAoInitialize.CheckInExtensionm_pAoInitialize.CheckInExtension(esriLicenseExtensionCode3DAnalyst)(esriLicenseExtensionCode3DAnalyst)m_pAoInitialize.Shutdownm_pAoInitialize.ShutdownEndEndSubSub


Consuming <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> orDesktop Licenses• <strong>Applications</strong> can initialize an <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> orDesktop license• Use IAoInitialize::IsProductCodeAvailable• May want to prompt the user …''TryTrytotocheckcheckoutout<strong>Engine</strong><strong>Engine</strong>licenselicensefirstfirstIfIfm_pAoInitialize.IsProductCodeAvailable(esriLicenseProductCode<strong>Engine</strong>)m_pAoInitialize.IsProductCodeAvailable(esriLicenseProductCode<strong>Engine</strong>)==esriLicenseAvailableesriLicenseAvailableThenThenm_pAoInitialize.Initializem_pAoInitialize.InitializeesriLicenseProductCode<strong>Engine</strong>esriLicenseProductCode<strong>Engine</strong>''TryTrytotocheckcheckoutoutDesktopDesktoplicenselicensenextnextElseIfElseIfm_pAoInitialize.IsProductCodeAvailable(esriLicenseProductCode<strong>Arc</strong>View)m_pAoInitialize.IsProductCodeAvailable(esriLicenseProductCode<strong>Arc</strong>View)==esriLicenseAvailableesriLicenseAvailableThenThenm_pAoInitialize.Initializem_pAoInitialize.InitializeesriLicenseProductCode<strong>Arc</strong>ViewesriLicenseProductCode<strong>Arc</strong>ViewEndEndIfIf


Licensing Rules• License initialization must occur before any<strong>Arc</strong>Objects code executes• A product license can be checked only once forthe duration of the application• Extension licenses can be checked in and outas necessary• Cannot combine or mix product and extensionlicenses• Always attempt to consume the lowest level oflicensing possible


<strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> controls• Mapping Controls: MapControl andPageLayoutControl• Framework Controls: TOCControl andToolbarControl• Reader Control: ReaderControl• Licensing Control


LicenseControl• Automatically performs license initialization andshutdown• Use property pages to set– Product– Extension


The MapControl• MapControl– Encapsulates the Map coclass– Draws a single data frame– Used for analysis and viewing– Exposes mouse and drawingevents– Loads map documents andother files


The PageLayoutControl• PageLayoutControl– Encapsulates thePageLayout coclass– Draws all elements in oneview– Creates layouts– Printing– Sets the current tool– Loads map documents


The Framework Controls• ToolbarControl and TOCControl are designed towork with all other controls• Communicate and synchronize with each other• Tied together through a buddy controlToolToolbarTOCBuddy Control


TOCControl• Displays all layers andsymbols for a control• Controls layer visibility• Must call SetBuddyControl• Limitations– No property pages, can’treorder layers,no default context menus…


ToolbarControl• Container for customcommands, tools, and menus• Allows commands to interactwith the objects in the controls– Map, PageLayout, Scene, andGlobe• Must call SetBuddyControl


The Mapping Control Commands• Prewritten commands, tools, toolbars, and menus for thecontrols• Commands and tools– Pan, zoom, open documents, graphics, etc• Toolbars– Feature selection, graphics, map navigation, and page layout• Menus– Feature selection and map view• Library– esriCommandControls.olb• References– OMD or tech docs


<strong>Developing</strong> with the3D Controls24


The SceneControl and GlobeControl• Encapsulate SceneViewer/GlobeViewer• Manage– General appearance– Scene/Globe– Scene graph/Globe display– Camera properties• Set the current tool• Load scene/globe documents


Globe and Scene Commands• Commands and tools– Pan, zoom, fly, setobserver, select• Toolbars– ControlsGlobeGlobeToolbar– ControlsGlobeRotateToolbar


• SceneDifferences between the scene andglobe– No projection requirements for data– Allows 3D line symbols (tubes, walls, textured lines)– Supports TIN data display and analysis• Globe– Data must have a defined spatial reference– Provides an efficient mechanism for large datadisplay– Supports different layer types:• MapServer, <strong>Arc</strong>IMS Image, feature annotation, MOLE


Types of Customizations andExtensions• Allow users to add and remove commands atruntime• Automatically save and load commands• Build and show menus on the fly• Different extensions can also be implemented– Create custom commands, tools, menus, andtoolbars– Custom extensionsTool ToolToolbarMenuTOCBuddy ControlRead/WriteApplicationData


Implementing Custom Commands• The framework gives you theability to create customcommands• Added seamlessly toToolbarControl• Steps1. Create a class2. Implement ICommand3. Add the class to the toolbarPublicPublicClassClassZoomToLayerClassZoomToLayerClassImplementsImplementsICommandICommand


Implementing Custom COMComponents• The framework can also be extended by writingcustom COM components• Types– Commands, tools, menus, toolbars, and extensions• General steps1. Create a project (VB, VC++, .NET, etc)2. Define the type library and class name3. Reference the appropriate <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> libraries4. Implement an interface5. Compile and register6. Register with a component category


Registering Custom COMComponents• All custom COM components should be registeredin the correct <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> component category• Makes classes available to CustomizeDialog class• Many ways to register– Categories.exe– ESRI Add-ins– Registration scripts (.reg)


The Customize Dialog• Modeless dialog that allows you to:– Add and remove commands from theToolbarControl at runtime– Browse existing ESRI commands,tools, menus, and toolbars– Drag and drop items• Need to enableprogrammatically


<strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> Runtime Product• Must be installed on every machine that yourapplication will run on• This also includes machines with <strong><strong>Arc</strong>GIS</strong>Desktop and Server• Freely distributable with the purchase of <strong><strong>Arc</strong>GIS</strong><strong>Engine</strong> Developer Kit!


The <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> Runtime Setup• An MSI package that installs all of the required featuresto support <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> applications• What does it contain?– <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong>– <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> Java Runtime– <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> .NET Runtime• Approximately 150 MB• 270 MB installed


Deployment Scenarios1. End user does not have <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong>Runtime2. End user has <strong><strong>Arc</strong>GIS</strong> Desktop installed


End User Does Not Have <strong><strong>Arc</strong>GIS</strong><strong>Engine</strong> Runtime• Deployment options:1. Your install prompts user to contactESRI to purchase Runtime2. You install the runtime for them• End user still needs to authorizesoftware– Contact ESRI to register the runtime– Authorize the software with the .ecp file– Updates C:\Program Files\ESRIESRI\License\sysgen\keycodes• Notes– Economical and easiest methodology for developers– End user will have to purchase the correct runtime license andextension


End user has <strong><strong>Arc</strong>GIS</strong> Desktopinstalled• Still required to install <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> Runtime• Your application will have to check out an<strong><strong>Arc</strong>GIS</strong> Desktop license• Different licenses available– Floating license– Single-seat license• Your application may be limited by the productlicense available– <strong>Arc</strong>View: Cannot update <strong>Arc</strong>SDE databases• Notes:– Checking out desktop licenses is expensive


Authorizing the software for end users• Your setup or application can automatically install andauthorize the <strong><strong>Arc</strong>GIS</strong> <strong>Engine</strong> Runtime• Methods1. Install program can call SoftwareAuthorization.exe/LIF /S - Silent2. Use AuthorizeLicense coclass and pass in a license code• Requirements to redistribute a license:– Must have an OEM agreement with ESRI– Requires that you are a business partner with ESRI• Contact– ESRI Business Partner <strong>Group</strong> or your International Distributor• Under no circumstances can you distribute the .ecp file

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!