Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "geocortex/infrastructure/MapUtils"

Index

Functions

cloneEsriFeature

  • cloneEsriFeature(feature: Graphic): Graphic
  • Parameters

    • feature: Graphic

    Returns Graphic

compareTypeSR

  • compareTypeSR(g1: Geometry, g2: Geometry): boolean
  • Parameters

    • g1: Geometry
    • g2: Geometry

    Returns boolean

esriExtentsEqual

  • esriExtentsEqual(thisGeom: Extent, oGeom: Extent): boolean
  • Parameters

    • thisGeom: Extent
    • oGeom: Extent

    Returns boolean

esriFeatureAttributesEqual

  • esriFeatureAttributesEqual(attributes1: any, attributes2: any, fieldsToIgnore?: string[]): boolean
  • Parameters

    • attributes1: any
    • attributes2: any
    • Optional fieldsToIgnore: string[]

    Returns boolean

esriFeaturesEqual

  • esriFeaturesEqual(graphic1: Graphic, graphic2: Graphic, layer?: FeatureLayer): boolean
  • Parameters

    • graphic1: Graphic
    • graphic2: Graphic
    • Optional layer: FeatureLayer

    Returns boolean

esriGeometriesEqual

  • esriGeometriesEqual(g1: Geometry, g2: Geometry): boolean
  • Parameters

    • g1: Geometry
    • g2: Geometry

    Returns boolean

esriMultipointsEqual

  • esriMultipointsEqual(thisGeom: Multipoint, oGeom: Multipoint): boolean
  • Parameters

    • thisGeom: Multipoint
    • oGeom: Multipoint

    Returns boolean

esriPointsEqual

  • esriPointsEqual(thisGeom: Point, oGeom: Point): boolean
  • Parameters

    • thisGeom: Point
    • oGeom: Point

    Returns boolean

esriPolygonsEqual

  • esriPolygonsEqual(thisGeom: Polygon, oGeom: Polygon): boolean
  • Parameters

    • thisGeom: Polygon
    • oGeom: Polygon

    Returns boolean

esriPolylinesEqual

  • esriPolylinesEqual(thisGeom: Polyline, oGeom: Polyline): boolean
  • Parameters

    • thisGeom: Polyline
    • oGeom: Polyline

    Returns boolean

findFeatureInLayer

  • findFeatureInLayer(feature: Graphic, layer: FeatureLayer): Graphic
  • Finds a feature on a given layer using structural comparison.

    Parameters

    • feature: Graphic

      The esri.Graphic to find.

    • layer: FeatureLayer

      The feature layer to search.

    Returns Graphic

findFeatureInMap

  • findFeatureInMap(feature: Graphic, site: Site, layerHint?: FeatureLayer): Graphic
  • Finds a feature on the map. This method is crucial for dealing with OnDemand layers, as feature instances obtained from OnDemand layers became detached from the map and we often need to re-attach to the "fresh" instance of a feature.

    Parameters

    • feature: Graphic

      The esri.Graphic to find.

    • site: Site

      The Site, containing the map.

    • Optional layerHint: FeatureLayer

      A layer possibly containing the feature, to search first.

    Returns Graphic

getClosestScale

  • This function will only be effective when the map has a tiled base map layer. In such cases, simply determining the scale at which a layer is visible may not be sufficient as this scale may fall between two LOD scale ranges. In such cases, esri will choose the LOD with the nearest scale to zoom to - but the layer may NOT be visible at that scale. This function fetches the scale of the nearest LOD (either less than or more than the specified scale) at which the layer will be visible.

    Parameters

    • map: Map
    • mode: ScaleChangeMode

      An enum which can be either "lessThan" or "greaterThan"

    • scale: number

      The target scale

    Returns number

    The nearest LOD with scale less than or more than (depending on mode) the target scale OR the input scale if a tiled base map is not added to the map

getExtent

  • getExtent(geometry: Geometry): Extent
  • Gets the current extent of the given geometry

    Parameters

    • geometry: Geometry

      The ESRI geometry whose extent is to be returned

    Returns Extent

    Extent of the given geometry

getThumbnailUri

  • getThumbnailUri(app: ViewerApplication, extent?: Extent, width?: number, height?: number, dpi?: number): Promise<string>
  • Get an image URI for the thumbnail. Can be a hosted image or a data URI.

    Parameters

    • app: ViewerApplication

      The application which contains the map to create a thumbnail for.

    • Optional extent: Extent

      The extent to create the thumbnail for. Defaults to the maps current extent.

    • Optional width: number

      The width of the thumbnail.

    • Optional height: number

      The height of the thumbnail.

    • Optional dpi: number

      The DPI to use for the thumbnail resolution.

    Returns Promise<string>

    A promise of the thumbnail.

panToPointWithPriority

  • panToPointWithPriority(app: ViewerApplication, geometry: Geometry, startupPriority: number, showMap: boolean): void
  • Pans to the given geometry after apply a projection if required.

    Parameters

    • app: ViewerApplication

      The application which contains the map to pan

    • geometry: Geometry

      The ESRI geometry which the map should be panned to

    • startupPriority: number

      The priority of this extent change if called while the map is still loading

    • showMap: boolean

    Returns void

stepZoom

  • stepZoom(map: Map, factor: number, zoomFromExtent: Extent): Extent
  • Scales the ESRI map's extent by the given factor

    Parameters

    • map: Map

      The ESRI map

    • factor: number

      The factor by which the map's extent need to be scaled

    • zoomFromExtent: Extent

      Value of initial extent of the map

    Returns Extent

    Value of the new scaled extent

stepZoomWithPriority

  • stepZoomWithPriority(site: Site, factor: number, zoomFromExtent: Extent, startupPriority?: number): Extent
  • Safely scales the ESRI map's extent by the given factor with the given priority and name

    Parameters

    • site: Site
    • factor: number

      The factor by which the map's extent need to be scaled

    • zoomFromExtent: Extent

      Value of initial extent of the map

    • Optional startupPriority: number

      The priority of this extent change if called while the map is still loading

    Returns Extent

    Value of the new scaled extent

zoomToExtent

  • Zooms to the given extent after applying a projection if required.

    Parameters

    • app: ViewerApplication

      The application which contains the map

    • extent: Extent

      The ESRI extent which the map should zoom to

    • showMap: boolean

      A boolean indicating if the map should be shown before performing the extent change

    Returns void

zoomToExtentWithPriority

  • zoomToExtentWithPriority(app: ViewerApplication, extent: Extent, startupPriority: number, showMap: boolean): void
  • Zooms to the given extent with the specified priority after applying a projection if required.

    Parameters

    • app: ViewerApplication

      The application which contains the map to pan

    • extent: Extent

      The ESRI extent which the map should zoom to

    • startupPriority: number

      The priority of this extent change if called while the map is still loading

    • showMap: boolean

    Returns void