Constructor for a MapViewer, setting:
Map properties
Language instance
Used to access button bar API to create buttons and button panels on the app-bar
Used to access basemap API functions
The controller registry owning all framework-level controllers
Used to access feature highlight API functions
Used to access the footer bar API to create buttons and footer panels on the footer-bar
Used to access geometry API to create and manage geometries
Max number of icons cached
Used to access layers functions
The OpenLayers map instance
Map features configuration properties
The id of the map
Modals creation
Used to access button bar API to create buttons and button panels on the nav-bar
Used to attach the notification class
The overview map React root
Plugins attached to the map
Used to manage states
StaticDEFAULT_Static ReadonlyDEFAULT_Static ReadonlyDEFAULT_Default DPI values
Static ReadonlyDEFAULT_Default inches per meter used by OpenLayers
StaticDEFAULT_Default densification number when forming layer extents, to make ture to compensate for earth curvature
Static ReadonlyZOOM_A zoom level buffer to guarantee that the calculations being done via the resolutions, inches per meter, dpi are more strict than not enough The value 0.21 seems rather specific, but it was the value giving us the best result during testing on layer National Forest Inventory Photo Plot Summary (6433173f-bca8-44e6-be8e-3e8a19d3c299) at zoom level 3.78 +/- 0.25 It could be increased slightly if ever we need to, but it might offer worse precision depending on various layers
Getter for map is init
Getter for map layers loaded
Getter for map layers processed
Getter for map is ready. A Map is ready when all layers have been processed.
Add a new custom component to the map.
An id to the new component
The component to add
Shows a marker on the map.
The marker to add
The projected coordinates of the marker
Transforms coordinate from map projection to given projection.
The given coordinate
The projection that should be output
The coordinate in the given projection
Transforms coordinate from given projection to the current projection of the map.
The given coordinate
The projection of the given coordinate
The coordinate in the map projection
Transforms coordinate from LonLat to the current projection of the map.
The LonLat coordinate
The coordinate in the map projection
Transforms coordinate from current projection of the map to LonLat.
The coordinate in map projection
The coordinate in LonLat
Transforms extent from map projection to given projection. If the projections are the same, the extent is simply returned.
The given extent
The projection that should be output
The extent in the given projection
Transforms extent from given projection to the current projection of the map.
The given extent
The projection of the given extent
The number of stops to perform densification on the extent
The extent in the map projection
Transforms extent from LonLat to the current projection of the map.
The LonLat extent
The number of stops to perform densification on the extent
The extent in the map projection
Transforms extent from current projection of the map to LonLat.
The extent in map projection
The extent in LonLat
Create an Open Layer map from configuration attached to the class. This function is called from a useEffect and should be running synchronously.
HTML element to create the map within
The OpenLayer map
Creates a map config based on current map state.
Optional - Indicates if geocore layer names should be kept as is or returned to defaults. Set to false after a language change to update the layer names with the new language.
Map config with current map state, or undefined if unavailable
Deletes the MapViewer, including its plugins, layers, etc. This function does not unmount the MapViewer. To completely delete a MapViewer, use cgpv.api.deleteMapViewer() which will delete the MapViewer and unmount it - for React.
A promise that resolves when the deletion is complete
Emits a map single click event.
NOTE: This Does not update the store, only emit the click.
The clicked coordinates to emit
Asynchronously gets the map center coordinate to give a chance for the map to render before returning the value.
A promise that resolves with the map center
Returns the click marker overlay.
The click marker overlay
Asynchronously gets the map coordinate from pixel to give a chance for the map to render before returning the value.
The pixel coordinate to convert
The maximum time in milliseconds to wait for the getCoordinateFromPixel to return a value
A promise that resolves with the map coordinate at the given pixel location
Retrieves the configuration object for a specific core plugin from the map's features configuration.
The ID of the core plugin to look up
The configuration object for the specified plugin, or undefined if not found
Returns the current display language.
The display language
Returns the current display theme.
The display theme
Gets geolocator search area.
The geolocator search area with coordinates and optional bounding box, or undefined if not set
Gets the i18nInstance for localization.
The i18n instance
Gets the ordered layer paths.
The ordered layer paths
Converts a map scale denominator (1:X) into the corresponding OpenLayers resolution.
Resolution is computed using: resolution = scale / (metersPerUnit * inchesPerMeter * dpi)
The scale denominator (e.g., 50000000 for 1:50,000,000). Optional; returns undefined if not provided.
Dots per inch to use for conversion. Defaults to MapViewer.DEFAULT_DPI (usually 96 or 90.714 depending on standard).
The map resolution in map units per pixel, or undefined if targetScale is not provided.
Gets map scale for Web Mercator or Lambert Conformal Conic projections.
The map scale (e.g. 50000 for 1:50,000), or undefined if meters per unit is unavailable
Converts a zoom level to a map scale.
The desired zoom (e.g. 50000 for 1:50,000)
The closest scale for the given zoom number, or undefined if meters per unit is unavailable
Asynchronously gets the map size to give a chance for the map to render before returning the value.
A promise that resolves with the map size
Returns the map current state information.
The map state
Converts a map scale denominator (1:X) into the corresponding OpenLayers zoom level.
Uses getMapResolutionFromScale internally and then computes the zoom for that resolution.
The scale denominator (e.g., 50000000 for 1:50,000,000). Optional; returns undefined if not provided.
Dots per inch to use for conversion. Defaults to MapViewer.DEFAULT_DPI.
The OpenLayers zoom level corresponding to the scale, or undefined if targetScale is not provided.
Get north arrow bearing. Angle use to rotate north arrow for non Web Mercator projection. https://www.movable-type.co.uk/scripts/latlong.html
The arrow angle
Returns the north pole marker overlay.
The north pole marker overlay
Gets if north pole is visible. This is not a perfect solution and is more a work around.
A promise that resolves with true if visible, false otherwise
Asynchronously attempts to get a plugin by its id.
The plugin id
A promise that resolves with the plugin
Gets the map projection.
The map projection
Gets the map projection EPSG string.
The map projection EPSG string
Gets the map projection number.
The map projection number
Gets the map viewSettings.
The map viewSettings
Initializes drawing interactions on the given vector source.
The geometry group key in which to hold the geometries
The type of geometry to draw (Polygon, LineString, Circle, etc)
The styles for the drawing
OptionalgeometryFunction: GeometryFunctionOptional geometry function for custom drawing behavior
The draw interaction
Initializes map, layer class and geometries. This function must be called once the Map is rendered.
A promise that resolves when the map initialization is complete
Initializes the map controls
Initializes modifying interactions on the given vector source.
The geometry group key in which to hold the geometries
Optionalstyle: TypeFeatureStyleOptional styles for the modification
OptionalinsertVertexCondition: ConditionOptional condition for inserting vertices
OptionalpixelTolerance: numberOptional pixel tolerance for modification
The modify interaction
Initializes selection interactions.
The select interaction
Initializes snapping interactions on the given vector source.
The geometry group key in which to hold the geometries
The snap interaction
Initializes transform interactions for feature manipulation.
Optionaloptions: Partial<TransformOptions>Optional options for the transform interaction
The transform interaction
Initializes translation interactions without requireing the extra selection click. Note: This will limit translation interactions to one feature at a time.
The translate interaction
Unregisters a map change size event callback.
The callback to stop being called whenever the event is emitted
Unregisters a component added event callback.
The callback to stop being called whenever the event is emitted
Unregisters a component removed event callback.
The callback to stop being called whenever the event is emitted
Unregisters a map init event callback.
The callback to stop being called whenever the event is emitted
Unregisters a language changed event callback.
The callback to stop being called whenever the event is emitted
Unregisters a map layers loaded event callback.
The callback to stop being called whenever the event is emitted
Unregisters a map layers processed event callback.
The callback to stop being called whenever the event is emitted
Unregisters a map move end event callback.
The callback to stop being called whenever the event is emitted
Unregisters a map pointer move event callback.
The callback to stop being called whenever the event is emitted
Unregisters a map pointer stop event callback.
The callback to stop being called whenever the event is emitted
Unregisters a map projection changed event callback.
The callback to stop being called whenever the event is emitted
Unregisters a map projection changed event callback.
The callback to stop being called whenever the event is emitted
Unregisters a map ready event callback.
The callback to stop being called whenever the event is emitted
Unregisters a map rotation event callback.
The callback to stop being called whenever the event is emitted
Unregisters a map single click end event callback.
The callback to stop being called whenever the event is emitted
Unregisters a map zoom end event callback.
The callback to stop being called whenever the event is emitted
Registers a map change size event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a component added event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a component removed event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a map init event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a language changed event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a map layers loaded event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a map layers processed event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a map move end event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a map pointer move event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a map pointer stop event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a map projection change event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a map projection change event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a map ready event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a map rotation event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a map single click event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Registers a map zoom end event callback.
The callback to be executed whenever the event is emitted
The callback delegate that was registered
Register handlers on pointer move and map single click.
Map to register events on
Remove an existing custom component from the map
The id of the component to remove
Searches through a map config and replaces any matching layer names with their provided partner.
The array of name pairs. Presumably one english and one french name in each pair
OptionalmapConfig: TypeMapFeaturesConfigOptional config to modify, or one created using the current map state if not provided
Optional - Whether or not names not provided should be removed from config
Map config with updated names, or undefined if no config is available
Rotates the view to align it at the given degrees.
The degrees to rotate the map to
Sets the timezone used to display date values for this map.
This affects how parsed date instants are converted and presented in the UI, without modifying the underlying stored values.
The IANA timezone identifier to use for display
Set map extent.
New extent to zoom to
A promise that resolves when the zoom operation completes
Set fullscreen / exit fullscreen.
Toggle fullscreen or exit fullscreen status
The element to toggle fullscreen on
Update nav bar home button view settings.
The new view settings
Set map to either dynamic or static.
Map interaction
Set the display language of the map.
The language to use (en, fr)
OptionalreloadLayers: booleanOptional flag to ask viewer to reload layers with the new localize language
A promise that resolves when the language change is complete
Set the map zoom level.
New zoom level
A promise that resolves when the zoom operation completes
Set the maximum extent of the map.
New extent to use
Set the maximum map zoom level.
New maximum zoom level
Set the minimum map zoom level.
New minimum zoom level
Set the display projection of the map.
The projection code (3978, 3857)
True if the projection was changed, false if the projection code is unsupported
Set the display theme of the map.
The theme to use (geo.ca, light, dark)
Set the map viewSettings (coordinate values in lon/lat).
Map viewSettings object
Simulate a map click and return promises of store update and ui update.
The lonlat coordinates to simulate
The simulated map click information
Unregister handlers on pointer move and map single click.
Map to unregister events on
Update the size of the icon image list based on styles.
The legend to check
Waits until all GeoView layers reach the specified status before resolving the promise.
This function repeatedly checks whether all layers have reached the given layerStatus.
The desired status to wait for (e.g., 'loaded', 'processed')
A promise that resolves with the number of layers that have reached the specified status
Waits for the map layers loaded event to be emitted.
A promise that resolves with the number of layers that have reached the specified status
Waits for the map to be ready before resolving the promise.
This function checks if the map is already ready, and if not, it waits for the onMapReady event to be triggered.
A promise that resolves when the map is ready.
Waits for the rendercomplete event to be triggered.
A promise that resolves when map render is complete
Zoom to the specified extent.
The extent to zoom to
Optionaloptions: FitOptionsOptional options to configure the zoomToExtent (default: { padding: [100, 100, 100, 100], maxZoom: 11 })
A promise that resolves when the zoom operation completes
Zoom to the initial extent defined in the map configuration.
A promise that resolves when the zoom operation completes
Zoom to specified extent or coordinate provided in lonlat.
The extent or coordinate to zoom to
Optionaloptions: FitOptionsOptional options to configure the zoomToExtent (default: { padding: [100, 100, 100, 100], maxZoom: 11 })
A promise that resolves when the zoom operation completes
StaticgetRetrieves the scale information from the DOM elements for the given map ID.
The unique identifier of the map.
The scale information object
Class used to manage created maps.