Skip to main content

Class: 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

Extends

Accessors

googleMapsApiKey

Get Signature

get googleMapsApiKey(): string
Returns

string

Inherited from

Mapsvg.googleMapsApiKey


nonce

Get Signature

get nonce(): string
Returns

string

Set Signature

set nonce(_nonce): void
Parameters
ParameterType
_noncestring
Returns

void

Inherited from

Mapsvg.nonce

Constructors

new MapsvgClient()

new MapsvgClient(): MapsvgClient

Returns

MapsvgClient

Overrides

Mapsvg.constructor

Methods

addInstance()

addInstance(mapsvg): void

Parameters

ParameterType
mapsvgany

Returns

void

Inherited from

Mapsvg.addInstance


extend()

extend(sub, base): void

Parameters

ParameterType
subany
baseany

Returns

void

Inherited from

Mapsvg.extend


extendBuiltins()

extendBuiltins(): void

Returns

void

Inherited from

Mapsvg.extendBuiltins


get()

get(index): MapSVGMap

Parameters

ParameterType
indexany

Returns

MapSVGMap

Inherited from

Mapsvg.get


getByContainerId()

getByContainerId(id): MapSVGMap

Parameters

ParameterType
idany

Returns

MapSVGMap

Inherited from

Mapsvg.getByContainerId


getById()

getById(id): MapSVGMap

Parameters

ParameterType
idany

Returns

MapSVGMap

Inherited from

Mapsvg.getById


init()

init(options): Promise<void>

Parameters

ParameterType
optionsMapsvgFrontendParams

Returns

Promise<void>

Inherited from

Mapsvg.init


lazyLoadMap()

lazyLoadMap(container): void

Parameters

ParameterType
containerHTMLElement

Returns

void

Inherited from

Mapsvg.lazyLoadMap


loadMap()

loadMap(container): void

Parameters

ParameterType
containerHTMLElement

Returns

void

Inherited from

Mapsvg.loadMap


loadMaps()

loadMaps(): void

Returns

void

Inherited from

Mapsvg.loadMaps


receiveMessageFromIframe()

receiveMessageFromIframe(event): void

Parameters

ParameterType
eventany

Returns

void

Inherited from

Mapsvg.receiveMessageFromIframe


setEventHandlers()

setEventHandlers(): void

Returns

void

Inherited from

Mapsvg.setEventHandlers


unloadMaps()

unloadMaps(): void

Returns

void

Inherited from

Mapsvg.unloadMaps


createClient()

static createClient(frontEndOptions?): Mapsvg

Parameters

ParameterType
frontEndOptions?MapsvgFrontendParams

Returns

Mapsvg

Inherited from

Mapsvg.createClient

Properties

_nonce

_nonce: string;

Inherited from

Mapsvg._nonce


arrayIndexed

arrayIndexed: typeof ArrayIndexed = ArrayIndexed;

customObject

customObject: typeof Model = Model;

defaultMarkerImage

defaultMarkerImage: string;

Inherited from

Mapsvg.defaultMarkerImage


distanceSearch

distanceSearch: any;

Inherited from

Mapsvg.distanceSearch


formBuilder

formBuilder: typeof FormBuilder = FormBuilder;

geoPoint

geoPoint: typeof GeoPoint = GeoPoint;

google_maps_api_key

google_maps_api_key: string;

Inherited from

Mapsvg.google_maps_api_key


googleMaps

googleMaps: object;

apiIsLoading

apiIsLoading: boolean;

apiKey

apiKey: string;

loaded

loaded: boolean;

onLoadCallbacks

onLoadCallbacks: () => void[];

Inherited from

Mapsvg.googleMaps


googleMapsApiLoaded

googleMapsApiLoaded: boolean = false;

Inherited from

Mapsvg.googleMapsApiLoaded


initialized

initialized: boolean;

Overrides

Mapsvg.initialized


instances

instances: MapSVGMap[];

Inherited from

Mapsvg.instances


loaded

loaded: boolean = false;

Inherited from

Mapsvg.loaded


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: object[];

Inherited from

Mapsvg.markerImages


mediaUploader

mediaUploader: any;

Inherited from

Mapsvg.mediaUploader


meta

meta: Record<string, any> = {};

Inherited from

Mapsvg.meta


mouse

mouse: object;

x

x: number;

y

y: number;

Inherited from

Mapsvg.mouse


query

query: typeof Query = Query;

region

region: typeof Region = Region;

repository

repository: typeof Repository = Repository;

ResizeSensor

ResizeSensor: typeof ResizeSensor;

Inherited from

Mapsvg.ResizeSensor


routes

routes: MapsvgRoutes;

Inherited from

Mapsvg.routes


schema

schema: typeof Schema = Schema;

schemaRepository

schemaRepository: typeof SchemaRepository = SchemaRepository;

screenPoint

screenPoint: typeof ScreenPoint = ScreenPoint;

server

server: typeof Server = Server;

svgPoint()

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

Parameters

ParameterType
x?number
y?number
z?number
w?number

Returns

DOMPoint

prototype

prototype: DOMPoint;

fromPoint()

MDN Reference

Parameters
ParameterType
other?DOMPointInit
Returns

DOMPoint


templatesLoaded

templatesLoaded: Record<string, boolean> = {};

Inherited from

Mapsvg.templatesLoaded


useRepository()

useRepository: (name, map) => Repository(name, map) => Repository(name, map) => SchemaRepository(name, map) => MapsRepository;

Parameters

ParameterType
name"regions" | SchemaOptions
mapMapSVGMap

Returns

Repository

Parameters

ParameterType
nameSchemaOptions | "objects"
mapMapSVGMap

Returns

Repository

Parameters

ParameterType
nameSchemaOptions | "schemas"
mapMapSVGMap

Returns

SchemaRepository

Parameters

ParameterType
nameSchemaOptions | "maps"
mapMapSVGMap

Returns

MapsRepository


utils

utils: object;

env

env: object;

env.getBrowser()

getBrowser: () => object;
Returns

object

firefox
firefox: boolean;
ie
ie: boolean;
safari
safari: boolean;

env.getDevice()

getDevice: () => object;
Returns

object

android
android: boolean;
ios
ios: boolean;

env.getMouseCoords()

getMouseCoords: (e) => object;
Parameters
ParameterType
eany
Returns

object

x
x: number;
y
y: number;

env.getUserAgent()

getUserAgent: () => string;
Returns

string

env.isMac()

isMac: () => boolean;
Returns

boolean

env.isPhone()

isPhone: () => boolean;
Returns

boolean

files

files: object;

files.getFileType()

getFileType: (url) => "JS" | "CSS" | "Unknown";
Parameters
ParameterType
urlany
Returns

"JS" | "CSS" | "Unknown"

files.loadFile()

loadFile: (file) => Promise<unknown>;
Parameters
ParameterType
fileany
Returns

Promise<unknown>

files.loadFiles()

loadFiles: (files) => Promise<any[]>;
Parameters
ParameterType
filesany
Returns

Promise<any[]>

funcs

funcs: object;

funcs.deepMerge()

deepMerge: <T, U>(target, source) => T & U<T, U, V>(target, middle, source) => T & U & V;
Type Parameters
Type Parameter
T
U
Parameters
ParameterType
targetT
sourceU
Returns

T & U

Type Parameters
Type Parameter
T
U
V
Parameters
ParameterType
targetT
middleU
sourceV
Returns

T & U & V

funcs.geocode()

geocode: (query, callback) => boolean;
Parameters
ParameterType
queryany
callbackany
Returns

boolean

funcs.getNestedValue()

getNestedValue: (obj, path) => any;
Parameters
ParameterType
objany
pathany
Returns

any

funcs.splitObjectAndField()

splitObjectAndField: (fields) => object;
Parameters
ParameterType
fieldsstring
Returns

object

field
field: string;
object
object: string;

funcs.throttle()

throttle: (method, delay, scope, params) => void;
Parameters
ParameterType
methodany
delayany
scopeany
paramsany
Returns

void

http

http: object;

http.handleFailedRequest()

handleFailedRequest: (response) => void;
Parameters
ParameterType
responseany
Returns

void

numbers

numbers: object;

numbers.compareVersions()

compareVersions: (v1, v2) => -1 | 0 | 1;
Parameters
ParameterType
v1any
v2any
Returns

-1 | 0 | 1

numbers.isNumber()

isNumber: (n) => boolean;
Parameters
ParameterType
nany
Returns

boolean

numbers.parseBoolean()

parseBoolean: (string) => boolean;
Parameters
ParameterType
stringany
Returns

boolean

strings

strings: object;

strings.convertToText()

convertToText: (obj) => any;
Parameters
ParameterType
objany
Returns

any

strings.fixColorHash()

fixColorHash: (color) => string;
Parameters
ParameterType
colorstring
Returns

string

strings.functionFromString

functionFromString: Object;

strings.removeLeadingSlash()

removeLeadingSlash: (str) => any;
Parameters
ParameterType
strany
Returns

any

strings.safeURL()

safeURL: (url) => any;
Parameters
ParameterType
urlany
Returns

any

strings.toSnakeCase()

toSnakeCase: (str) => string;
Parameters
ParameterType
strstring
Returns

string

strings.ucfirst()

ucfirst: (string) => any;
Parameters
ParameterType
stringany
Returns

any


version

version: string = "process.env.VERSION";

Inherited from

Mapsvg.version


initialized

static initialized: boolean = false;

Inherited from

Mapsvg.initialized