MapSVGMap
Index
Constructors
Properties
- $gauge
- _scale
- _viewBox
- afterLoadBlockers
- canZoom
- changedFields
- changedSearch
- clickAddsMarker
- clusterizerWorker
- clusters
- clustersByZoom
- containerId
- containers
- containersCreated
- controllerMiddleWare
- controllers
- controls
- converter
- defaults
- dirtyFields
- disableLinks
- editData
- editMarkers
- editRegions
- editingMarker
- events
- eventsBaseInitialized
- eventsPreventList
- extras
- filtersRepository
- filtersSchema
- firefoxScroll
- firstDataLoad
- fitDelta
- fitOnDataLoadDone
- formBuilder
- galleries
- geoCoordinates
- geoViewBox
- googleMaps
- googleMapsScript
- groups
- highlightedRegions
- highlighted_marker
- id
- inBackend
- iosDownscaleFactor
- isScrolling
- isZooming
- lastTimeFitWas
- layers
- liveCss
- loaded
- locationField
- mapDataLoaded
- mapDataPromise
- mapIsGeo
- mapLatBottomDegree
- mapLonDelta
- markerEditHandler
- markerOptions
- markers
- markersClusters
- middlewares
- objectClickedBeforeScroll
- objects
- objectsRepository
- options
- optionsDelta
- popoverShowingFor
- regionEditHandler
- regions
- regionsRepository
- resizeSensor
- scale
- scaleDistStart
- schemaRepository
- scroll
- scrollStarted
- selected_id
- selected_marker
- setMarkersByField
- superScale
- svgDefault
- svgFileLastChanged
- svgFileLoaded
- svgFileLoadedPromise
- svgFileLoadedResolve
- svgFilePromise
- templates
- tooltip
- touchZoomStart
- userLocation
- userLocationMarker
- vbStart
- version
- viewBox
- whRatio
- zoomDelta
- zoomLevel
- zoomLevels
Methods
- _new_setChoropleth
- addObject
- attachDataToRegions
- bubblesRegionsMoveScreenPositionBy
- centerOn
- clearDirtyFields
- convertMouseToSVG
- createContainers
- createGoogleMapOverlay
- deleteClusters
- deleteMarkers
- deselectAllMarkers
- deselectAllRegions
- deselectMarker
- deselectRegion
- destroy
- directoryFilterOut
- extractField
- fitMarkers
- fitViewBox
- getBubbleSize
- getCenterGeoPoint
- getCenterSvgPoint
- getChoroplethColor
- getContainer
- getConverter
- getData
- getDb
- getDbRegions
- getDirtyFields
- getEditingMarker
- getGeoViewBox
- getGroupBBox
- getGroupSelectOptions
- getLayer
- getMarker
- getOptions
- getPagination
- getRegion
- getRegionStylesByState
- getRegions
- getScale
- getSelected
- getUserLocation
- getViewBox
- getZoomForGoogle
- getZoomRange
- hidePopover
- highlightMarker
- highlightRegions
- initMap
- isGeo
- isRegionDisabled
- labelsRegionsMoveScreenPositionBy
- linkObjectToRegions
- loadDataObjects
- loadDirectory
- loadFiltersController
- loadItemsToDirectory
- loadMap
- loadPreviousMap
- loadSvgFile
- markerAdd
- markerAddClickHandler
- markerClickHandler
- markerClusterClickHandler
- markerDelete
- markerRemove
- markersAdjustScreenPosition
- markersClusterAdd
- markersMoveScreenPositionBy
- mouseWheelZoom
- objectsLoadedToMapHandler
- panBy
- pickChoroplethColor
- popoverAdjustScreenPosition
- popoverMoveScreenPositionBy
- popoverOffHandler
- redraw
- redrawBubbles
- regionClickHandler
- reloadAllRegionStyles
- reloadRegionStyles
- reloadRegions
- reloadRegionsFull
- scrollStart
- selectMarker
- selectRegion
- setActions
- setChoropleth
- setChoroplethSourceField
- setColors
- setContainers
- setControls
- setCursor
- setDatabase
- setDetailsView
- setDirectory
- setDisableAll
- setDisableLinks
- setEditingMarker
- setEvents
- setFilters
- setFiltersSchema
- setFitSingleMarkerZoom
- setGoogleMaps
- setLabelsMarkers
- setLabelsRegions
- setLoadingText
- setMiddleware
- setMiddlewares
- setMobileView
- setMultiSelect
- setObjectClickedBeforeScroll
- setPagination
- setPopovers
- setRegionEditHandler
- setRegions
- setRepositoryEvents
- setResponsive
- setScroll
- setSize
- setSvgFileLastChanged
- setTemplates
- setTooltips
- setViewBox
- setViewBoxByGoogleMapBounds
- setViewBoxByGoogleMapsOverlay
- setZoom
- showDetails
- showPopover
- showTooltip
- showUserLocation
- unhighlightMarker
- unhighlightRegions
- update
- updateGoogleMapsMaxZoom
- viewBoxReset
- viewBoxSetBySize
- zoom
- zoomIn
- zoomOut
- zoomTo
Constructors
constructor
Parameters
containerId: string
mapParams: { id?: number; options?: MapOptions; svgFileLastChanged?: string | number; version?: string }
params: { inBackend?: boolean; prefetch?: boolean } = ...
Returns MapSVGMap
Properties
$gauge
_scale
Relative map scale from initial zoom level
_viewBox
Initial viewBox
afterLoadBlockers
AfterLoad event can be blocked by:
- Loading Google API JS files
- Loading filters controller When a blocker is introduced, it increases the number of afterLoadBlockers when mapsvg.finalizeMapLoading is called, it checks if afterLoadBlockers = 0
canZoom
changedFields
changedSearch
clickAddsMarker
clusterizerWorker
Clusterizer worker
clusters
Array of Marker clusters
clustersByZoom
Sets of pre-calculated clusters for every zoom level
containerId
containers
Map containers
Type declaration
optionalchoroplethSourceSelect?: { container: HTMLElement; options: HTMLElement[]; select: HTMLElement }
container: HTMLElement
options: HTMLElement[]
select: HTMLElement
optionalclustersCss?: HTMLStyleElement
optionalclustersHoverCss?: HTMLStyleElement
optionalcontrols?: HTMLElement
optionaldetailsView?: HTMLElement
Details view container
optionaldirectory?: HTMLElement
Directory container
optionalfilterTags?: HTMLElement
optionalfilters?: HTMLElement
Filters container
optionalfiltersModal?: HTMLElement
optionalfooter?: HTMLElement
optionalgoogleMaps?: HTMLElement
Google Maps container
optionalheader?: HTMLElement
optionallayers?: HTMLElement
Layers container
optionallayersControl?: HTMLElement
Layers controls container
optionallayersControlLabel?: HTMLElement
optionallayersControlList?: HTMLElement
optionallayersControlListNano?: HTMLElement
optionalleftSidebar?: HTMLElement
optionallegend?: { coloring: HTMLElement; container: HTMLElement; description: HTMLElement; text: HTMLElement; title: HTMLElement }
coloring: HTMLElement
container: HTMLElement
description: HTMLElement
text: HTMLElement
title: HTMLElement
optionalloading?: HTMLElement
Container for "Loading map..." message
optionalmap?: HTMLElement
Map container
optionalmapContainer?: HTMLElement
Parent map container
optionalmarkersCss?: HTMLStyleElement
optionalpagerDir?: HTMLElement
optionalpagerMap?: HTMLElement
optionalpopover?: HTMLElement
Popover container
optionalrightSidebar?: HTMLElement
optionalscrollpane?: HTMLElement
Scrolling container
optionalscrollpaneWrap?: HTMLElement
Wrapper of scrolling container
optionalsvg?: SVGSVGElement
SVG image container
optionaltooltipCluster?: HTMLElement
Tooltip container
optionaltooltipMarker?: HTMLElement
Tooltip container
optionaltooltipRegion?: HTMLElement
Tooltip container
optionalwrap?: HTMLElement
Wrapper of map container
optionalwrapAll?: HTMLElement
Main wrapper for all containers
optionalzoomButtons?: HTMLElement
containersCreated
controllerMiddleWare
controllers
Map controllers
Example:
const { popover } = map.controllers
popover.show()
Type declaration
optionaldetailsView?: DetailsController
optionaldirectory?: DirectoryController
optionalfilters?: FiltersController
optionalpopover?: PopoverController
optionaltooltips?: { cluster?: Tooltip; marker?: Tooltip; region?: Tooltip }
controls
Type declaration
previousMap: HTMLElement
userLocation: HTMLElement
zoom: HTMLElement
zoomReset: HTMLElement
converter
defaults
dirtyFields
disableLinks
editData
Type declaration
on: boolean
editMarkers
Type declaration
on: boolean
editRegions
Type declaration
on: boolean
editingMarker
Reference to a Marker currently edited (dragged)
events
eventsBaseInitialized
eventsPreventList
Type declaration
[key string]: boolean
extras
Type declaration
[key string]: any
optionalprefetch?: boolean
filtersRepository
filtersSchema
Schema for the map filters (set of fields and their parameters)
firefoxScroll
Type declaration
insideIframe: boolean
scrollX: number
scrollY: number
firstDataLoad
Flag indicating first data load
fitDelta
fitOnDataLoadDone
formBuilder
galleries
geoCoordinates
geoViewBox
Geo ViewBiox, containing to geo-points: SW(lat,lng) and NE(lat,lng)
optionalgoogleMaps
Type declaration
optionalcurrentMaxZoom?: number
initialized: boolean
loaded: boolean
map: Map
optionalmaxZoomService?: MaxZoomService
optionaloverlay?: any
optionalzoomLimit?: boolean
googleMapsScript
groups
highlightedRegions
highlighted_marker
id
inBackend
iosDownscaleFactor
Flag defining whether map needs to be downscaled or upscaled to prevent blurring on iOS devices
isScrolling
isZooming
Flag defining whether the map is zooming at the moment
lastTimeFitWas
layers
Type declaration
[key string]: HTMLElement
liveCss
loaded
locationField
mapDataLoaded
mapDataPromise
mapIsGeo
mapLatBottomDegree
mapLonDelta
markerEditHandler
Type declaration
Parameters
location: Location
Returns void
markerOptions
markers
Array of Markers
Example:
map.markers.forEach(marker => marker.hide())
markersClusters
Array of Marker clusters
middlewares
objectClickedBeforeScroll
objects
objectsRepository
options
optionsDelta
Type declaration
[key string]: any
popoverShowingFor
regionEditHandler
Type declaration
Returns void
regions
regionsRepository
resizeSensor
scale
Current map scale relative to original size
scaleDistStart
schemaRepository
scroll
Scroll coordinates
Type declaration
optionaldx?: number
optionaldy?: number
optionalgx?: number
optionalgy?: number
touchScrollStart: number
optionaltx?: number
optionalty?: number
optionalvx?: number
optionalvxi?: number
optionalvy?: number
optionalvyi?: number
optionalx?: number
optionaly?: number
scrollStarted
selected_id
An array of selected reion IDs
selected_marker
A reference ot currently selected marker
setMarkersByField
superScale
svgDefault
Type declaration
optionalgeoViewBox?: GeoViewBox
optionalheight?: number
optionalviewBox?: ViewBox
optionalwidth?: number
svgFileLastChanged
svgFileLoaded
svgFileLoadedPromise
svgFileLoadedResolve
Type declaration
Parameters
value: boolean | PromiseLike<boolean>
Returns void
svgFilePromise
templates
Handlebars templates (for Details View, Popover, etc.)
Type declaration
[key string]: any
tooltip
Type declaration
mirror: {}
[key string]: number
posOriginal: {}
[key string]: string
posShifted: {}
[key string]: string
posShiftedPrev: {}
[key string]: string
touchZoomStart
userLocation
userLocationMarker
vbStart
version
viewBox
Current viewBox
whRatio
Width/height ratio
Type declaration
current: number
original: number
zoomDelta
zoomLevel
Current map zoom level
zoomLevels
The list of all zoom levels, with viewBoxes
Methods
_new_setChoropleth
Sets choropleth map options
Parameters
optionaloptions: any
Returns void
addObject
Parameters
object: Model
Returns void
attachDataToRegions
Attaches DB Objects to Regions
Parameters
optionalobject: Model
Returns void
bubblesRegionsMoveScreenPositionBy
Move position of Regions bubbles by given numbers
Parameters
deltaX: number
deltaY: number
Returns void
centerOn
clearDirtyFields
Returns void
convertMouseToSVG
Converts mouse pointer coordinates to SVG coordinates
Parameters
e: TriggeredEvent
Event object
Returns SVGPoint
- [x,y] SVG coordinates
createContainers
Returns void
createGoogleMapOverlay
Parameters
bounds: any
map: any
Returns GoogleMapsOverlay
deleteClusters
Delete all clusters from the map
Returns void
deleteMarkers
Delete all markers
Returns void
deselectAllMarkers
Deselects all Markers
Returns void
deselectAllRegions
Deselects all Regions
Returns void
deselectMarker
Deselects one Marker
Parameters
marker: Marker
Returns void
deselectRegion
Deselects one Region
Parameters
region: Region
Returns void
destroy
Destroys the map and all related containers.
Returns void
directoryFilterOut
Filter out directory items
Parameters
items: any
Returns any
extractField
fitMarkers
Changes maps viewBox to fit loaded markers.
Returns void
fitViewBox
Parameters
fitViewBox: ViewBox
forceZoomLevel: number
Returns boolean
getBubbleSize
Returns size of the choropleth bubble
Parameters
region: Region
Returns any
getCenterGeoPoint
Returns lat,lng coordinates of center of the current view
Returns GeoPoint
getCenterSvgPoint
Returns SVG coordinates of the center of current map position
Returns SVGPoint
getChoroplethColor
Returns color of the Region for choropleth map
Parameters
region: Region
Returns string
color
getContainer
Parameters
name: string
Returns HTMLElement
getConverter
Returns Converter
getData
Returns { id: number; options: MapOptions; svgFileLastChanged: number; title: string; version: string }
id: number
options: MapOptions
svgFileLastChanged: number
title: string
version: string
getDb
Returns Database
Returns Repository<Model>
getDbRegions
Returns Regions database
Returns Repository<Model>
getDirtyFields
Returns {}
[key string]: any
getEditingMarker
Returns marker that is currently in the "edit mode" Used in Map Editor.
Returns Marker
getGeoViewBox
Returns geo-bounds of the map.
Returns number[]
- [leftLon, topLat, rightLon, bottomLat]
getGroupBBox
Parameters
mapObjects: (Marker | Region | MarkerCluster)[]
Returns ViewBox
getGroupSelectOptions
Returns the list of options for visibility settings in admin.js
Returns any[]
getLayer
Returns layer by provided name
Parameters
name: string
Returns HTMLElement
getMarker
Finds a Marker by ID
Parameters
id: string
Marker ID
Returns Marker
getOptions
Returns map options.
Parameters
forTemplate: boolean
If options should be formatted for use in a template
forWeb: boolean
If options should be formatted for use in the web
Returns MapOptions
getPagination
Generates HTML with pagination buttons and attaches callback event on button click
Parameters
optionalcallback: () => void
Callback function that should be called on click on a next/prev page button
Returns HTMLElement
getRegion
Finds a Region by ID
Parameters
id: string
Region ID
Returns Region
getRegionStylesByState
Parameters
region: Region
Returns RegionStylesByStatus
getRegions
Returns all Regions
Returns ArrayIndexed<Region>
getScale
Returns current SVG scale related to screen - map screen pixels to SVG points ratio. Example: if SVG current viewBox width is 600 and the map is shown in a 300px container, the map scale is 0.5 (300/600 = 0.5)
Returns number
Map scale related to screen
getSelected
Returns array of IDs of selected Regions
Returns string[]
getUserLocation
Gets user's current location by using browser's HTML5 geolocation feature. Works only under HTTPS connection!
Parameters
callback: (coordinates: GeoPoint) => void
Callback to be called when user location is received
Returns boolean
- false if geolocation is unavailable, or true if it's available
getViewBox
Returns current viewBox
Returns ViewBox
ViewBox
getZoomForGoogle
Returns zoom level adjusted for Google Maps
Returns number
getZoomRange
Returns { max: number; min: number }
max: number
min: number
hidePopover
Hides the popover
Returns void
highlightMarker
Highlight marker
Parameters
marker: Marker
Returns void
highlightRegions
Highlights an array of Regions (used on mouseover)
Parameters
regions: Region[]
Returns void
initMap
Parameters
_options: MapOptions
optionaldata: any
Returns Promise<void>
isGeo
Checks if the map is geo-calibrated
Returns boolean
isRegionDisabled
Checks if Region should be disabled
Parameters
id: string
Region ID
svgfill: string
Region color ("fill" attribute)
Returns boolean
- "true" if Region should be disabled.
labelsRegionsMoveScreenPositionBy
Move position of Region Labels by given numbers
Parameters
deltaX: number
deltaY: number
Returns void
linkObjectToRegions
Connect object to regions
Parameters
object: Model
Object to connect
Returns void
loadDataObjects
Parameters
optionalparams: any
Returns JQueryDeferred<any>
loadDirectory
Returns void
loadFiltersController
Loads filters controller into a provided container
Parameters
container: HTMLElement
Container, jQuery object
modal: boolean = false
If filter should be in a modal window
Returns void
loadItemsToDirectory
Loads items from a source defined in settings to the directory. The source can be "Regions" or "Database".
Returns boolean
loadMap
Gets map settings from the server
Parameters
id: string | number
container: HTMLElement
Returns void
loadPreviousMap
Load previous map from the history (MapSVGMap.options.previousMapsIds)
Returns void
loadSvgFile
Parameters
svgFileUrl: any
svgFileLastChanged: number = 1
Returns Promise<void | Response>
markerAdd
Adds a marker to the map.
Parameters
marker: any
Returns void
markerAddClickHandler
Event handler that creates marker on click on the map. Used in the Map Editor.
Parameters
e: TriggeredEvent
Event object
Returns void
markerClickHandler
Parameters
e: TriggeredEvent
marker: Marker
Returns void
markerClusterClickHandler
Parameters
e: TriggeredEvent
markerCluster: MarkerCluster
Returns void
markerDelete
Deletes a marker
Parameters
marker: Marker
Returns void
markerRemove
Removes marker from the map
Parameters
marker: Marker
Returns void
markersAdjustScreenPosition
Adjusts position of Markers and MarkerClusters. This method is called on zoom or when map container is resized.
Returns void
markersClusterAdd
Adds a marker cluster
Parameters
markersCluster: MarkerCluster
Returns void
markersMoveScreenPositionBy
Move Markers and clusters by given numbers.
Parameters
deltaX: number
deltaY: number
Returns void
mouseWheelZoom
Parameters
event: MouseEventBase<any, any, any, any>
Returns void
objectsLoadedToMapHandler
Returns void
panBy
Shift the map by x,y pixels
Parameters
x: number
y: number
Returns { x: boolean; y: boolean }
x: boolean
y: boolean
pickChoroplethColor
For choropleth map: returns color for given number value
Parameters
choroplethValue: number
Number value
Returns { a: number; b: number; g: number; r: number }
- Color values, 0-255.
a: number
b: number
g: number
r: number
popoverAdjustScreenPosition
Adjusts popover position. User on zoom and when map container is resized.
Returns void
popoverMoveScreenPositionBy
Moves popover position. User on zoom and when map container is resized.
Parameters
deltaX: number
deltaY: number
Returns void
popoverOffHandler
Event handler that catches clicks outside of the popover and closes the popover.
Parameters
e: TriggeredEvent
Event object
Returns void
redraw
Redraws the map. Must be called when the map is shown after being hidden.
Returns void
redrawBubbles
Redraws choropleth bubbles.
Returns void
regionClickHandler
Parameters
e: TriggeredEvent
region: Region
Returns void
reloadAllRegionStyles
Redraws colors of regions. Used when Region statuses are loaded from the database or when choropleth map is enabled.
Returns void
reloadRegionStyles
Parameters
region: Region
Returns void
reloadRegions
Reloads Regions from SVG file
Returns void
reloadRegionsFull
Reloads Regions data
Returns void
scrollStart
Event handler - called when map scroll starts
Parameters
e: TouchEventBase
mapsvg: MapSVGMap
Returns void
selectMarker
Selects a Marker
Parameters
marker: Marker
Returns void
selectRegion
Selects a Region
Parameters
id: string | Region
Region or ID
optionalskipDirectorySelection: boolean
Returns void
setActions
Sets map actions that should be performed on Region click. Marker click, etc.
Parameters
options: any
Returns void
setChoropleth
Sets choropleth map options
Parameters
optionaloptions: any
Returns void
setChoroplethSourceField
Sets the field that is used for choropleth map
Parameters
field: any
field name
Returns void
setColors
Sets color settings (background, regions, containers, etc.)
Parameters
optionalcolors: {}
Returns void
setContainers
Sets container options: leftSidebar, rightSidebar, header, footer.
Parameters
options: any
Returns void
setControls
Sets map control buttons.
Parameters
options: any
control button options
Returns void
setCursor
Sets mouse pointer cursor style on hover on regions / markers.
Parameters
type: any
"pointer" or "default"
Returns void
setDatabase
Sets database options.
Parameters
optionaloptions: any
Returns void
setDetailsView
Sets Details View options
Parameters
optionaloptions: {}
Options
Returns void
setDirectory
Sets directory options.
Parameters
options: any
Returns void
setDisableAll
Disables all Regions if "true" is passed.
Parameters
on: boolean
Returns void
setDisableLinks
Disables/enables redirection by link on click on a region or marker when "Go to link..." feature is enabled Used to prevent redirection in the map editor.
Parameters
on: boolean
true (enable redirection) of false (disable)
Returns void
setEditingMarker
Sets marker into "edit mode". Used in Map Editor.
Parameters
marker: Marker
Returns void
setEvents
Sets event handlers
Parameters
functions: {}
Object containing the event handlers:
{eventName: callback, eventName2: callback}
optionalunique: boolean
Returns void
setFilters
Sets filter options
Parameters
optionaloptions: {}
Returns void
setFiltersSchema
Sets the filters schema for the map. The filters schema defines the available filters for the map.
Parameters
optionalfiltersSchema: any[]
An array of filter fields. Each field is an object with the following properties:
id
(string): The unique identifier of the filter field.title
(string): The title of the filter field.type
(string): The type of the filter field. Supported types are: "text", "select", "checkbox", "radio", "range".options
(object): Additional options for the filter field. The options depend on the filter type.
Returns void
setFitSingleMarkerZoom
Parameters
zoom: any
Returns void
setGoogleMaps
Sets Google Map options.
Parameters
optionaloptions: any
Returns void
setLabelsMarkers
Sets Marker labels
Parameters
optionaloptions: any
Returns void
setLabelsRegions
Parameters
optionaloptions: any
Returns void
setLoadingText
Sets loading text message
Parameters
message: string
Returns void
setMiddleware
Type parameters
Parameters
name: T
handler: MiddlewareHandlers[T]
unique: boolean = false
Returns void
setMiddlewares
Parameters
functions: { mapLoad: string | MapLoadMiddleware; render: string | RenderMiddleware; request: string | RequestMiddleware; response: string | ResponseMiddleware }
unique: boolean = false
Returns void
setMobileView
Sets mobile view options
Parameters
options: any
Returns void
setMultiSelect
Enables/disables "multiselect" option that allows to select multiple regions.
Parameters
on: boolean
optionaldeselect: boolean
If true, deselects currently selected Regions
Returns void
setObjectClickedBeforeScroll
Save the Region ID that was clicked before starting map scroll. It is used to trigger .regionClickHandler() later if scroll was less than 5px
Parameters
object: Marker | Region | MarkerCluster
Returns void
setPagination
Adds pagination controls to the map and/or directory
Returns void
setPopovers
Sets popover options.
Parameters
options: any
Returns void
setRegionEditHandler
Sets callback function that is called on click on a Region. Used in the Map Editor on click on a Region in the "Edit regions" map mode.
Parameters
handler: () => void
Returns void
setRegions
Parameters
options: RegionOptionsCollection
Returns void
setRepositoryEvents
Returns void
setResponsive
Sets map responsiveness on/off. When map is responsive, it takes the full width of the parent container.
Parameters
on: boolean
Returns void
setScroll
Sets map scroll options.
Parameters
options: any
scroll options
skipEvents: any
used by Map Editor to prevent re-setting event handlers.
Returns void
setSize
Sets map size. Can accept both or just 1 parameter - width or height. The missing parameter will be calcualted.
Parameters
width: number
height: number
optionalresponsive: boolean
Returns void
- [width, height]
setSvgFileLastChanged
Parameters
val: number
Returns void
setTemplates
Sets templates body
Parameters
templates: any
Key:value pairs of template names and HTML content
Returns void
setTooltips
Sets tooltips options.
Parameters
options: { on: boolean }
Returns void
setViewBox
Sets map viewbox
Parameters
optionalviewBox: ViewBox
adjustGoogleMap: boolean = true
Returns boolean
setViewBoxByGoogleMapBounds
Sets SVG viewBox by Google Maps bounds. Used to overlay SVG map on Google Map.
Returns void
setViewBoxByGoogleMapsOverlay
Returns void
setZoom
Sets map zoom options.
Parameters
options: any
zoom options
Returns void
showDetails
showPopover
publicshowTooltip
Parameters
object: Marker | Region | MarkerCluster
Returns void
showUserLocation
Shows user current location Works only under HTTPS connection
Parameters
callback: (location: Location) => void
Callback to be called when user location is received
Returns void
unhighlightMarker
Unhighlights all Regions (used on mouseout)
Returns void
unhighlightRegions
Unhighlights all Regions (used on mouseout)
Returns void
update
Updates map settings.
Parameters
options: Omit<MapOptions, id>
Map options
Returns void
updateGoogleMapsMaxZoom
Parameters
geoPoint: GeoPoint
Returns void
viewBoxReset
Resets map zoom and scroll to initial position.
Parameters
toInitial: boolean
Set to "true" if you want to reset to initial viewBox that was set by user; set to "false" to reset to original SVG viewBox as defined in the SVG file
Returns ViewBox
ViewBox
viewBoxSetBySize
Sets map container size and viewBox size. This method should be used when you need to change both map container size and viewBox size.
Parameters
width: number
Width of map container
height: number
Height of map container
Returns ViewBox
ViewBox
zoom
Zooms the map
Parameters
delta: number
1/-1
optionalcenter: SVGPoint
[x,y] zoom center point
Returns void
zoomIn
Zooms-in the map
Parameters
optionalcenter: SVGPoint
if provided, zoom will shift the center point
Returns void
zoomOut
Zooms-out the map
Parameters
optionalcenter: SVGPoint
Center point (optional)
Returns void
zoomTo
Zooms to Region, Marker or array of Markers.
Parameters
mapObjects: Marker | Region | Region[] | MarkerCluster | Marker[] | MarkerCluster[]
Region ID, Region, Marker, array of Markers, array of MarkerClusters
optionalzoomToLevel: number
Zoom level
Returns boolean
MapSVGMap class. Creates a new map inside of the given HTML container, which is typically a DIV element.
The class constructor is available in the global varialbe, as
mapsvg.map
.Example usage: