By Daniel Du
This is second part of AIMS API training materials. This part will cover an overview of AIMS/MapGuide API including Server API and Viewer API.
In AIMS/MapGuide Server API, it contains 8 services, they are:
Site Service |
The most commonly used services are Resource Service and Feature Service. Besides the services, there are some additional objects including Geometry, Coordinate related objects and other common objects.
A service performs a particular set of related functions. For example, a resource service manages data in the repository, a feature service provides access to feature data sources, and a mapping service provides visualization and plotting functions. Before a page can use a service, it must open a site connection and create an instance of the necessary service type. All other 6 services are created by site service from a site connection. The following php code creates a resource service and a feature service, please find the .net code samples here:
$userInfo = new MgUserInformation($mgSessionId); $siteConnection = new MgSiteConnection(); $siteConnection->Open($userInfo); $resourceService = $siteConnection-> CreateService(MgServiceType::ResourceService); $featureService = $siteConnection-> CreateService(MgServiceType::FeatureService);
At client side, you can use Ajax viewer(Basic web layout) or Fusion viewer(Flexible web layout) on browser, or Mobile viewer on a mobile device. You are recommended to use fusion viewer if you are familiar with web programing as it give your more flexibility to extend/customize it to meet your need. The document can be found here and this DevTV may also be helpful for you. Furthermore, all source code of fusion viewer is released with the product, you can dig into the source code if some APIs are not documented. Now please check out the chapter 2 of training materials. The code sample of solution2 can be downloaded here.