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
nonce
Get Signature
get nonce(): string
Returns
string
Set Signature
set nonce(_nonce): void
Parameters
Parameter | Type |
---|---|
_nonce | string |
Returns
void
Inherited from
Constructors
new MapsvgClient()
new MapsvgClient(): MapsvgClient
Returns
Overrides
Methods
addInstance()
addInstance(mapsvg): void
Parameters
Parameter | Type |
---|---|
mapsvg | any |
Returns
void
Inherited from
extend()
extend(sub, base): void
Parameters
Parameter | Type |
---|---|
sub | any |
base | any |
Returns
void
Inherited from
extendBuiltins()
extendBuiltins(): void
Returns
void
Inherited from
get()
get(index): MapSVGMap
Parameters
Parameter | Type |
---|---|
index | any |
Returns
Inherited from
getByContainerId()
getByContainerId(id): MapSVGMap
Parameters
Parameter | Type |
---|---|
id | any |
Returns
Inherited from
getById()
getById(id): MapSVGMap
Parameters
Parameter | Type |
---|---|
id | any |
Returns
Inherited from
init()
init(options): Promise<void>
Parameters
Parameter | Type |
---|---|
options | MapsvgFrontendParams |
Returns
Promise
<void
>
Inherited from
lazyLoadMap()
lazyLoadMap(container): void
Parameters
Parameter | Type |
---|---|
container | HTMLElement |
Returns
void
Inherited from
loadMap()
loadMap(container): void
Parameters
Parameter | Type |
---|---|
container | HTMLElement |
Returns
void
Inherited from
loadMaps()
loadMaps(): void
Returns
void
Inherited from
receiveMessageFromIframe()
receiveMessageFromIframe(event): void
Parameters
Parameter | Type |
---|---|
event | any |
Returns
void
Inherited from
Mapsvg
.receiveMessageFromIframe
setEventHandlers()
setEventHandlers(): void
Returns
void
Inherited from
unloadMaps()
unloadMaps(): void
Returns
void
Inherited from
createClient()
static createClient(frontEndOptions?): Mapsvg
Parameters
Parameter | Type |
---|---|
frontEndOptions ? | MapsvgFrontendParams |
Returns
Inherited from
Properties
_nonce
_nonce: string;
Inherited from
arrayIndexed
arrayIndexed: typeof ArrayIndexed = ArrayIndexed;
customObject
customObject: typeof Model = Model;
defaultMarkerImage
defaultMarkerImage: string;
Inherited from
distanceSearch
distanceSearch: any;
Inherited from
formBuilder
formBuilder: typeof FormBuilder = FormBuilder;
geoPoint
geoPoint: typeof GeoPoint = GeoPoint;
google_maps_api_key
google_maps_api_key: string;
Inherited from
googleMaps
googleMaps: object;
apiIsLoading
apiIsLoading: boolean;
apiKey
apiKey: string;
loaded
loaded: boolean;
onLoadCallbacks
onLoadCallbacks: () => void[];
Inherited from
googleMapsApiLoaded
googleMapsApiLoaded: boolean = false;
Inherited from
initialized
initialized: boolean;
Overrides
instances
instances: MapSVGMap[];
Inherited from
loaded
loaded: boolean = false;
Inherited from
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
mediaUploader
mediaUploader: any;
Inherited from
meta
meta: Record<string, any> = {};
Inherited from
mouse
mouse: object;
x
x: number;
y
y: number;
Inherited from
query
query: typeof Query = Query;
region
region: typeof Region = Region;
repository
repository: typeof Repository = Repository;
ResizeSensor
ResizeSensor: typeof ResizeSensor;
Inherited from
routes
routes: MapsvgRoutes;
Inherited from
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
Parameter | Type |
---|---|
x ? | number |
y ? | number |
z ? | number |
w ? | number |
Returns
DOMPoint
prototype
prototype: DOMPoint;
fromPoint()
Parameters
Parameter | Type |
---|---|
other ? | DOMPointInit |
Returns
DOMPoint
templatesLoaded
templatesLoaded: Record<string, boolean> = {};
Inherited from
useRepository()
useRepository: (name, map) => Repository(name, map) => Repository(name, map) => SchemaRepository(name, map) => MapsRepository;
Parameters
Parameter | Type |
---|---|
name | "regions" | SchemaOptions |
map | MapSVGMap |
Returns
Parameters
Parameter | Type |
---|---|
name | SchemaOptions | "objects" |
map | MapSVGMap |
Returns
Parameters
Parameter | Type |
---|---|
name | SchemaOptions | "schemas" |
map | MapSVGMap |
Returns
Parameters
Parameter | Type |
---|---|
name | SchemaOptions | "maps" |
map | MapSVGMap |
Returns
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
Parameter | Type |
---|---|
e | any |
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
Parameter | Type |
---|---|
url | any |
Returns
"JS"
| "CSS"
| "Unknown"
files.loadFile()
loadFile: (file) => Promise<unknown>;
Parameters
Parameter | Type |
---|---|
file | any |
Returns
Promise
<unknown
>
files.loadFiles()
loadFiles: (files) => Promise<any[]>;
Parameters
Parameter | Type |
---|---|
files | any |
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
Parameter | Type |
---|---|
target | T |
source | U |
Returns
T
& U
Type Parameters
Type Parameter |
---|
T |
U |
V |
Parameters
Parameter | Type |
---|---|
target | T |
middle | U |
source | V |
Returns
T
& U
& V
funcs.geocode()
geocode: (query, callback) => boolean;
Parameters
Parameter | Type |
---|---|
query | any |
callback | any |
Returns
boolean
funcs.getNestedValue()
getNestedValue: (obj, path) => any;
Parameters
Parameter | Type |
---|---|
obj | any |
path | any |
Returns
any
funcs.splitObjectAndField()
splitObjectAndField: (fields) => object;
Parameters
Parameter | Type |
---|---|
fields | string |
Returns
object
field
field: string;
object
object: string;
funcs.throttle()
throttle: (method, delay, scope, params) => void;
Parameters
Parameter | Type |
---|---|
method | any |
delay | any |
scope | any |
params | any |
Returns
void
http
http: object;
http.handleFailedRequest()
handleFailedRequest: (response) => void;
Parameters
Parameter | Type |
---|---|
response | any |
Returns
void
numbers
numbers: object;
numbers.compareVersions()
compareVersions: (v1, v2) => -1 | 0 | 1;
Parameters
Parameter | Type |
---|---|
v1 | any |
v2 | any |
Returns
-1
| 0
| 1
numbers.isNumber()
isNumber: (n) => boolean;
Parameters
Parameter | Type |
---|---|
n | any |
Returns
boolean
numbers.parseBoolean()
parseBoolean: (string) => boolean;
Parameters
Parameter | Type |
---|---|
string | any |
Returns
boolean
strings
strings: object;
strings.convertToText()
convertToText: (obj) => any;
Parameters
Parameter | Type |
---|---|
obj | any |
Returns
any
strings.fixColorHash()
fixColorHash: (color) => string;
Parameters
Parameter | Type |
---|---|
color | string |
Returns
string
strings.functionFromString
functionFromString: Object;
strings.removeLeadingSlash()
removeLeadingSlash: (str) => any;
Parameters
Parameter | Type |
---|---|
str | any |
Returns
any
strings.safeURL()
safeURL: (url) => any;
Parameters
Parameter | Type |
---|---|
url | any |
Returns
any
strings.toSnakeCase()
toSnakeCase: (str) => string;
Parameters
Parameter | Type |
---|---|
str | string |
Returns
string
strings.ucfirst()
ucfirst: (string) => any;
Parameters
Parameter | Type |
---|---|
string | any |
Returns
any
version
version: string = "process.env.VERSION";
Inherited from
initialized
static initialized: boolean = false;