Skip to main content

MapsvgClient

Client class, globally available as mapsvg or window.mapsvg. It contains all of the classes and utilities. Example usage:

// Init objects
const map = new mapsvg.map(...)
const location = new mapsvg.location(...)

// Get map
const map = mapsvg.getById(12)

// Use utilities
if(mapsvg.utils.env.isPhone()) {
// do something for mobile devices
}

const capitalizedString = map.utils.strings.ucfirst("orange") // > Orange

Hierarchy

Index

Constructors

constructor

Properties

ResizeSensor

ResizeSensor: typeof ResizeSensor = ResizeSensor

_nonce

_nonce: string

arrayIndexed

arrayIndexed: typeof ArrayIndexed = ArrayIndexed

customObject

customObject: typeof Model = Model

defaultMarkerImage

defaultMarkerImage: string

distanceSearch

distanceSearch: any

formBuilder

formBuilder: typeof FormBuilder = FormBuilder

geoPoint

geoPoint: typeof GeoPoint = GeoPoint

googleMaps

googleMaps: { apiIsLoading: boolean; apiKey: string; loaded: boolean; onLoadCallbacks: () => void[] }

Type declaration

  • apiIsLoading: boolean
  • apiKey: string
  • loaded: boolean
  • onLoadCallbacks: () => void[]

googleMapsApiLoaded

googleMapsApiLoaded: boolean = false

google_maps_api_key

google_maps_api_key: string

initialized

initialized: boolean

instances

instances: MapSVGMap[]

loaded

loaded: boolean = false

location

location: typeof Location = Location

map

map: typeof MapSVGMap = MapSVGMap

mapsRepository

mapsRepository: typeof MapsRepository = MapsRepository

mapsV2Repository

mapsV2Repository: typeof MapsV2Repository = MapsV2Repository

marker

marker: typeof Marker = Marker

markerImages

markerImages: { file: string; folder: string; relativeUrl?: string; url: string }[]

mediaUploader

mediaUploader: any

meta

meta: Record<string, any> = {}

mouse

mouse: { x: number; y: number } = ...

Type declaration

  • x: number
  • y: number

query

query: typeof Query = Query

region

region: typeof Region = Region

repository

repository: typeof Repository = Repository

routes

routes: MapsvgRoutes

schema

schema: typeof Schema = Schema

schemaRepository

schemaRepository: typeof SchemaRepository = SchemaRepository

screenPoint

screenPoint: typeof ScreenPoint = ScreenPoint

server

server: typeof Server = Server

svgPoint

svgPoint: new (x?: number, y?: number, z?: number, w?: number) => DOMPoint = SVGPoint

Type declaration

    • new (x?: number, y?: number, z?: number, w?: number): DOMPoint
    • Parameters

      • optionalx: number
      • optionaly: number
      • optionalz: number
      • optionalw: number

      Returns DOMPoint

templatesLoaded

templatesLoaded: Record<string, boolean> = {}

useRepository

useRepository: { (name: regions | SchemaOptions, map: MapSVGMap): Repository; (name: SchemaOptions | objects, map: MapSVGMap): Repository; (name: SchemaOptions | schemas, map: MapSVGMap): SchemaRepository; (name: SchemaOptions | maps, map: MapSVGMap): MapsRepository }

Type declaration

utils

utils: { env: { getBrowser: () => { firefox: boolean; ie: boolean; safari: boolean }; getDevice: () => { android: boolean; ios: boolean }; getMouseCoords: (e: any) => { x: number; y: number }; getUserAgent: () => string; isMac: () => boolean; isPhone: () => boolean }; files: { getFileType: (url: any) => JS | CSS | Unknown; loadFile: (file: any) => Promise<unknown>; loadFiles: (files: any) => Promise<any[]> }; funcs: { deepMerge: { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, middle: U, source: V): T & U & V }; geocode: (query: any, callback: any) => boolean; getNestedValue: (obj: any, path: any) => any; splitObjectAndField: (fields: string) => { field: string; object: string }; throttle: (method: any, delay: any, scope: any, params: any) => void }; http: { handleFailedRequest: (response: any) => void }; numbers: { compareVersions: (v1: any, v2: any) => -1 | 0 | 1; isNumber: (n: any) => boolean; parseBoolean: (string: any) => boolean }; strings: { convertToText: (obj: any) => any; fixColorHash: (color: string) => string; functionFromString: Object; removeLeadingSlash: (str: any) => any; safeURL: (url: any) => any; toSnakeCase: (str: string) => string; ucfirst: (string: any) => any } } = utils

Type declaration

  • env: { getBrowser: () => { firefox: boolean; ie: boolean; safari: boolean }; getDevice: () => { android: boolean; ios: boolean }; getMouseCoords: (e: any) => { x: number; y: number }; getUserAgent: () => string; isMac: () => boolean; isPhone: () => boolean }
    • getBrowser: () => { firefox: boolean; ie: boolean; safari: boolean }
        • (): { firefox: boolean; ie: boolean; safari: boolean }
        • Returns { firefox: boolean; ie: boolean; safari: boolean }

          • firefox: boolean
          • ie: boolean
          • safari: boolean
    • getDevice: () => { android: boolean; ios: boolean }
        • (): { android: boolean; ios: boolean }
        • Returns { android: boolean; ios: boolean }

          • android: boolean
          • ios: boolean
    • getMouseCoords: (e: any) => { x: number; y: number }
        • (e: any): { x: number; y: number }
        • Parameters

          • e: any

          Returns { x: number; y: number }

          • x: number
          • y: number
    • getUserAgent: () => string
        • (): string
        • Returns string

    • isMac: () => boolean
        • (): boolean
        • Returns boolean

    • isPhone: () => boolean
        • (): boolean
        • Returns boolean

  • files: { getFileType: (url: any) => JS | CSS | Unknown; loadFile: (file: any) => Promise<unknown>; loadFiles: (files: any) => Promise<any[]> }
    • getFileType: (url: any) => JS | CSS | Unknown
        • (url: any): JS | CSS | Unknown
        • Parameters

          • url: any

          Returns JS | CSS | Unknown

    • loadFile: (file: any) => Promise<unknown>
        • (file: any): Promise<unknown>
        • Parameters

          • file: any

          Returns Promise<unknown>

    • loadFiles: (files: any) => Promise<any[]>
        • (files: any): Promise<any[]>
        • Parameters

          • files: any

          Returns Promise<any[]>

  • funcs: { deepMerge: { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, middle: U, source: V): T & U & V }; geocode: (query: any, callback: any) => boolean; getNestedValue: (obj: any, path: any) => any; splitObjectAndField: (fields: string) => { field: string; object: string }; throttle: (method: any, delay: any, scope: any, params: any) => void }
    • deepMerge: { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, middle: U, source: V): T & U & V }
        • <T, U>(target: T, source: U): T & U
        • <T, U, V>(target: T, middle: U, source: V): T & U & V
        • Type parameters

          • T
          • U

          Parameters

          • target: T
          • source: U

          Returns T & U

        • Type parameters

          • T
          • U
          • V

          Parameters

          • target: T
          • middle: U
          • source: V

          Returns T & U & V

    • geocode: (query: any, callback: any) => boolean
        • (query: any, callback: any): boolean
        • Parameters

          • query: any
          • callback: any

          Returns boolean

    • getNestedValue: (obj: any, path: any) => any
        • (obj: any, path: any): any
        • Parameters

          • obj: any
          • path: any

          Returns any

    • splitObjectAndField: (fields: string) => { field: string; object: string }
        • (fields: string): { field: string; object: string }
        • Parameters

          • fields: string

          Returns { field: string; object: string }

          • field: string
          • object: string
    • throttle: (method: any, delay: any, scope: any, params: any) => void
        • (method: any, delay: any, scope: any, params: any): void
        • Parameters

          • method: any
          • delay: any
          • scope: any
          • params: any

          Returns void

  • http: { handleFailedRequest: (response: any) => void }
    • handleFailedRequest: (response: any) => void
        • (response: any): void
        • Parameters

          • response: any

          Returns void

  • numbers: { compareVersions: (v1: any, v2: any) => -1 | 0 | 1; isNumber: (n: any) => boolean; parseBoolean: (string: any) => boolean }
    • compareVersions: (v1: any, v2: any) => -1 | 0 | 1
        • (v1: any, v2: any): -1 | 0 | 1
        • Parameters

          • v1: any
          • v2: any

          Returns -1 | 0 | 1

    • isNumber: (n: any) => boolean
        • (n: any): boolean
        • Parameters

          • n: any

          Returns boolean

    • parseBoolean: (string: any) => boolean
        • (string: any): boolean
        • Parameters

          • string: any

          Returns boolean

  • strings: { convertToText: (obj: any) => any; fixColorHash: (color: string) => string; functionFromString: Object; removeLeadingSlash: (str: any) => any; safeURL: (url: any) => any; toSnakeCase: (str: string) => string; ucfirst: (string: any) => any }
    • convertToText: (obj: any) => any
        • (obj: any): any
        • Parameters

          • obj: any

          Returns any

    • fixColorHash: (color: string) => string
        • (color: string): string
        • Parameters

          • color: string

          Returns string

    • functionFromString: Object
    • removeLeadingSlash: (str: any) => any
        • (str: any): any
        • Parameters

          • str: any

          Returns any

    • safeURL: (url: any) => any
        • (url: any): any
        • Parameters

          • url: any

          Returns any

    • toSnakeCase: (str: string) => string
        • (str: string): string
        • Parameters

          • str: string

          Returns string

    • ucfirst: (string: any) => any
        • (string: any): any
        • Parameters

          • string: any

          Returns any

version

version: string = "process.env.VERSION"

staticinitialized

initialized: boolean = false

Accessors

googleMapsApiKey

  • get googleMapsApiKey(): string
  • Returns string

nonce

  • get nonce(): string
  • set nonce(_nonce: string): void
  • Returns string

  • Parameters

    • _nonce: string

    Returns void

Methods

addInstance

  • addInstance(mapsvg: any): void
  • Parameters

    • mapsvg: any

    Returns void

extend

  • extend(sub: any, base: any): void
  • Parameters

    • sub: any
    • base: any

    Returns void

extendBuiltins

  • extendBuiltins(): void
  • Returns void

get

  • Parameters

    • index: any

    Returns MapSVGMap

getByContainerId

  • Parameters

    • id: any

    Returns MapSVGMap

getById

  • Parameters

    • id: any

    Returns MapSVGMap

init

lazyLoadMap

  • lazyLoadMap(container: HTMLElement): void
  • Parameters

    • container: HTMLElement

    Returns void

loadMap

  • loadMap(container: HTMLElement): void
  • Parameters

    • container: HTMLElement

    Returns void

loadMaps

  • loadMaps(): void
  • Returns void

receiveMessageFromIframe

  • receiveMessageFromIframe(event: any): void
  • Parameters

    • event: any

    Returns void

setEventHandlers

  • setEventHandlers(): void
  • Returns void

unloadMaps

  • unloadMaps(): void
  • Returns void

staticcreateClient