Map

The Map class creates a container and required DOM structure for adding layers, graphics, an info window, and other navigation controls. Typically, a map is added to a page using a DIV. The map's width and height are initialized to those of the DIV container. The load event is fired after the first layer has been added to the map. At this point, the map is fully functional.

See Loading a Map.

AGISMap

 var map = new AGISMap(divId,Options?);

Constructors

Name Summary
new AGISMap(divId, parameters?) Creates a new AGIS map inside of the given HTML container,which is often a DIV element.
Constructor Parameters
<Node | String>divId Required Container id for the referencing map. Required.
<Object> parameters Required Optional parameters. See below<Object> parameters list.
<Object> parameters properties:
agencyCode Required Agency code for a map
aaServiceId Required Define service id for integration product.
userId Required User id which come from other applications, and keep consistent with AGIS retrieved
groupId Required Defined for controlling user permission
lang Option Support internationalization, default value is English.
product Required For integration with other products, default value is Civic Platform.
commands [command item] Option When requesting a map with AGIS API, there should be parameter to define the map commands needed in each scenario. The parameter should map to Map Commands defined inside AGIS.
Command item: <Object>
action Required The command action key: CREATE_CAP SHOW_RECORD SEND_GIS_FEATURE SHOW_GISINFORMATION BUFFER_SELECT ATTACH_RECORD DRIVETIME_BUFFERSELECT
label Required Defined label for command.

Properties

Name Type Summary
autoResize Boolean Value is true when the map automatically resizes,if the browser window or ContentPane widget enclosing the map is resized.
basemapLayerIds String[] An array of IDs corresponding to the layers that make up the map's current basemap.
extent Extent The current extent of the map in map units.
fadeOnZoom Boolean Indicates if the fade effect is enabled while zooming.
force3DTransforms Boolean When the mapNavigation mode is set to 'css-transforms', CSS3 transforms will be used for map navigation when supported by the browser.
graphics GraphicsLayer Provides access to the Map's GraphicsLayer.
graphicsLayerIds String[] An array of the current GraphicsLayers in the map.
height Number Current height of the map in screen pixels.
id String Reference to HTML DIV or other element where the map is placed on the page.
loaded Boolean After the first layer is loaded, the value is set to true.
navigationMode String Indicates whether the map uses CSS3 transformations when panning and zooming.
position Point This point geometry in screen coordinates represent the top-left corner of the map container.
root Node The DOM node that contains the container of layers,build-in info window, logo and slider.
visible Boolean Indicates whether map is visible.
width Number Current width of the map in screen pixels.

Methods

Name Return type Summary
locate(locateData, fun?) None Locate Accela business data. (Locate Completed function: function(){alert('ok');})
highlight(locateData) None Highlight and enlarge corresponding located marker on map. (locateData only need id)
destroy() None Destroys the AGIS map instance.
routing(routingStops[]) None Routing data.
setVisibility(visible) Map Show or hide the map.
showZoomSlider() None Shows the zoom slider on the map.

Locate Data Format

  1. Locate Address
    
    {
      "addresses": [
        { 
          "id": "c7da34dccb2a41e5b921177bd568cbfc", 
          "attributes": { 
             "Address": "2431 CAPITOL AVE",
             "Neighborhood": "", 
             "City": "", 
             "StreetName": "CAPITOL", 
             "Postal": "95816", 
             "StreetNumber": "2431", 
             "CountryCode": "", 
             "StreetSuffix": "AVE", 
             "Direction": "" 
          } 
       }, 
       { 
          "id": "aed25e01f37b4325a2bf039bbaf9fcf9", 
          "location": { 
             " XCoordinate": 23.24554, 
             " YCoordinate": 87.5541 
          } 
       } 
     ] 
    } 
    
  2. Locate Parcel
    
    { 
      "parcels": [
        { 
          "id": "c669b63cf49d4939824b13e2e1124a44", 
          "parcelId": "00301340110000", 
          "gisobjects": [
          { 
            "id": "dcec92d66464458a969714e90e69449d", 
            "layerId": "Parcels", 
            "gisid": "00301340110000" 
          }] 
        }, 
        {
          "id": "428315e5e36f49fab4f0b42d1dcb7816", 
          "parcelId": "00301340110000", 
          "gisobjects": [
          { 
            "id": "0d8305f4286b476ea1fc128abcfcd6b6", 
            "layerId": "Parcels", 
            "gisid": "00301340110000" 
          }],
          "addresses": [] //refer to locate Address 
        } 
      ] 
    }
    
  3. Locate Record
    
    { 
      "records": [ 
       { 
         "id": "1193a3cc74554392af642f4183e0381d", 
         "recordId": "ORE15-00000055", 
         "gisobjects": [ 
         { 
           "id": "ad0f6e3a2dc047bc8c394fe7a53b8dc3", 
           "layerId": "Major_Roads_2005", 
           "gisid": "6093" 
         }, 
         { 
           "id": "5c3eeccdffd34a569d1a05b4acc4d51c", 
           "layerId": "Parks", 
           "gisid": "211" 
         }, 
         { 
           "id": "e9c519a71fb4414e91ef0f25890904c0", 
           "layerId": "Parks", 
           "gisid": "181" 
           } 
         ], 
       "parcels": [], //refer to locate Parcels 
       "addresses": [] //refer to locate Address 
      } 
    ] 
    }
    

Events

Name Event Object Summary
mapLoaded {map: <map>} Complete when AGIS map has been successfully added to the map.
sendGISFeature {eventType: <commondtype> eventData: <gisfeature> } Fires when GIS command raised.
attachToRecord {eventType: <commondtype> eventData: <gisfeature> } Attach GIS feature to record.