- utils
- debounce ⇒
Taken from https://davidwalsh.name/function-debounce
- htmlEscape ⇒
htmlString
- htmlEncode ⇒
htmlString
Taken from https://davidwalsh.name/function-debounce
Returns: void
Param | Type |
---|---|
func | function |
wait | number |
immediate | boolean |
Param | Type |
---|---|
html | htmlString |
Param | Type |
---|---|
encode | htmlString |
Kind: global class
- DealerLocator
- new DealerLocator()
- .module.exports
- .defaultConfig ⇒
Object
- .setData(data) ⇒
- .setRequestOptions(requestOptions) ⇒
- .initializeMap() ⇒
Promise.<undefined>
- .showAll() ⇒
Promise.<undefined>
- .searchFor(address, resultRadius) ⇒
Promise.<undefined>
- .mapIsLoaded() ⇒
boolean
- .getCurrentLocation() ⇒
google.maps.Latlng
- .locateUser(resultRadius, zoom) ⇒
Promise.<(undefined|Object)>
- .setMapZoom(zoom) ⇒
- .setMaxResults(max) ⇒
- .updateView() ⇒
Promise.<undefined>
- .closeInfoWindow() ⇒
- .addFilterFor(key, value) ⇒
Promise.<undefined>
- .removeFilter(key, value) ⇒
Promise
- .addRadiusFilterFor(radius) ⇒
Promise.<undefined>
- .removeFilterType(type) ⇒
Promise.<undefined>
controller-class, providing functionality used by the ui
Kind: static class of DealerLocator
Creates an instance of DealerLocator. !! 'distance' and 'id' (items of key templateVars in mapOptions) are properties which cannot change their name/key !!
Param | Type |
---|---|
config | defaultConfig |
returns default parameters for DealerLocator:constructor overwrite it with your settings in DealerLocator:constructor(config)
mapContainer: required resultEl: required resultsContainer: required apiKey: required computeDistanceBetweenPoints: required mapOptions: required urlGenerator: optional hasCluster: optional mapsDataSource: optional {MapsDataSource} mapsDataService: optional {MapsDataService} googleMap: optional {GoogleMap}
Kind: static property of DealerLocator
Access: public
calls MapsDataSource to set data if no urlGenerator is passed
Kind: static method of DealerLocator
Returns: void
Access: public
Param | Type |
---|---|
data | array |
set requestOptions used in MapsDataSource to fetch data requestOptions can contain following keys: method, acceptType, body, formData, transformer
Kind: static method of DealerLocator
Returns: void
Access: public
Param | Type |
---|---|
requestOptions | Object |
load mapsAPI and update views with data afterwards
Kind: static method of DealerLocator
Access: public
resets all filters, geolocation/radius + properties and displays all tupels cached or to be loaded
Kind: static method of DealerLocator
Access: public
geolocating an address or plz, centers map to result and adds radius-filter as well as showing its results
Kind: static method of DealerLocator
Access: public
Param | Type |
---|---|
address | string |
resultRadius | number |
mapsAPI loaded/ready or not
Kind: static method of DealerLocator
Access: public
get current center of gmap
Kind: static method of DealerLocator
Access: public
locates client on gmap and sets class-prop this.clientLatLong for later calculations to show marker near client sets zoomlevel of gmap
Kind: static method of DealerLocator
Access: public
Param | Type |
---|---|
resultRadius | number |
zoom | number |
set zoom-level of gmap
Kind: static method of DealerLocator
Returns: void
Access: public
Param | Type |
---|---|
zoom | number |
set a limit to the result-set
use it before using updateView() to apply the behaviour set it to undefined if no limit is needed
Kind: static method of DealerLocator
Returns: void
Access: public
Param | Type |
---|---|
max | number |
updates map and custom-results views, for example after a filter has been applied
Kind: static method of DealerLocator
Access: public
closes currently opened infowindow on gmap
Kind: static method of DealerLocator
Returns: void
Access: public
add filter for property-key and -value
Kind: static method of DealerLocator
Access: public
Param | Type |
---|---|
key | string |
value | any |
remove previously added filter-option
Kind: static method of DealerLocator
Access: public
Param | Type |
---|---|
key | string |
value | any |
removes old radius-filter and adds passed radius as new radius-filter
Kind: static method of DealerLocator
Access: public
Param | Type |
---|---|
radius | number |
reset filter for specific type: radius or property
Kind: static method of DealerLocator
Access: public
Param | Type |
---|---|
type | string |
Kind: global class
- GoogleMap
- new GoogleMap()
- .module.exports
- .clientLatLong
- .clientLatLong ⇒
google.maps.LatLng
- .isLoaded ⇒
boolean
- .markers ⇒
array.<google.maps.Marker>
- .load() ⇒
- .parseInfoWindow(marker, template) ⇒
Promise
- .parseTemplate(templateContainer) ⇒
htmlString
- .replaceTemplateVar(tmpl, templateVar, delimiters, properties) ⇒
htmlString
- .closeInfoWindow() ⇒
- .setZoom(zoom) ⇒
- .updateView() ⇒
Promise.<undefined>
- .getMarkers() ⇒
Promise.<array.<google.maps.marker>>
- .searchFor(address) ⇒
Promise.<any>
- ._geocode(parameters) ⇒
Promise.<Object>
exposing api's to interact with google.map instance
Kind: static class of GoogleMap
new module.exports(apiKey, mapContainer, hasCluster, hasCustomResults, mapsDataService, resultEl, resultsContainer, configOptions)
Param | Type |
---|---|
apiKey | string |
mapContainer | string |
hasCluster | boolean |
hasCustomResults | boolean |
mapsDataService | MapsDataService |
resultEl | string |
resultsContainer | string |
configOptions | Object |
Kind: static property of GoogleMap
Param | Type |
---|---|
Object.<(lat|lng), number> |
Kind: static property of GoogleMap
Kind: static property of GoogleMap
Kind: static property of GoogleMap
initialize gmap api load and callbacks
Kind: static method of GoogleMap
Returns: void
Access: public
parses data and template into google.maps.infowindow
Kind: static method of GoogleMap
Access: public
Param | Type |
---|---|
marker | google.maps.Marker |
template | string |
template for popup when clicked on position on gmap !! distance and id are properties which cannot change their name/key !!
Kind: static method of GoogleMap
Access: public
Param | Type |
---|---|
templateContainer | string |
Object.<(properties.<Object>|id)> |
Replaces template vars in passed template. Escapes html to prevent xss and tries to replace html encoded templatevars as well
Kind: static method of GoogleMap
Returns: htmlString
- tmpl
Access: public
Param | Type |
---|---|
tmpl | htmlString |
templateVar | string |
delimiters | array |
properties | object |
closes currently opened infowindow on gmap
Kind: static method of GoogleMap
Returns: void
Access: public
sets zoom-level of gmap
Kind: static method of GoogleMap
Returns: void
Access: public
Param | Type |
---|---|
zoom | number |
Kind: static method of GoogleMap
Access: public
generates marker-objects from a dataSource
Kind: static method of GoogleMap
Access: public
searches by address sets this.clientLatLong to result pos
Kind: static method of GoogleMap
Access: public
Param | Type |
---|---|
address | string |
in preparation of reverse geocoding where user gets located on page load, this location is a latLng and has to be transfered into a location/country
resources: https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse?hl=de https://developers.google.com/maps/documentation/geocoding/intro?hl=de#Viewports
{'address': address} | {'location': latlng}
Kind: static method of GoogleMap
Access: public
Param | Type |
---|---|
parameters | object |
Kind: global class
- MapsDataService
- new MapsDataService()
- .module.exports
- .maxResults
- .getItems() ⇒
Promise.<undefined>
- .setData(data) ⇒
- .addFilterFor(propName, propValue) ⇒
- .removeFilterFor(propName, propValue) ⇒
- .addRadiusFilterFor(center, radius) ⇒
- .removeFilterType(type) ⇒
- .resetFilters() ⇒
- .ensureDetailsFor(ids) ⇒
Promise.<array>
- .hasActiveRadiusFilter() ⇒
boolean
provides logic for MapsDataSource, primarily filtering data
Kind: static class of MapsDataService
Creates an instance of MapsDataService.
Param | Type |
---|---|
mapsDataSource | MapsDataSource |
computeDistanceBetweenPoints | function | undefined |
Kind: static property of MapsDataService
Param | Type |
---|---|
max | number |
returns filtered data
Kind: static method of MapsDataService
Access: public
prefills data of maps data source if no urlGenerator is passed
Kind: static method of MapsDataService
Returns: void
Access: public
Param | Type |
---|---|
data | array |
add filter-option, does not apply them to data yet
Kind: static method of MapsDataService
Returns: void
Access: public
Param | Type |
---|---|
propName | string |
propValue | any |
remove a specific previously added filter-option, does not apply to data yet
Kind: static method of MapsDataService
Returns: void
Access: public
Param | Type |
---|---|
propName | string |
propValue | any |
add filter for radius search
Kind: static method of MapsDataService
Returns: void
Access: public
Param | Type |
---|---|
center | number |
radius | number |
remove filter of type "radius" or "property"
Kind: static method of MapsDataService
Returns: void
Access: public
Param | Type |
---|---|
type | string |
reset all previously applied filters
Kind: static method of MapsDataService
Returns: void
Access: public
use to check if tuple/s has/have extended properties already loaded, if not it´ll be loaded
Kind: static method of MapsDataService
Access: public
Param | Type |
---|---|
ids | any |
checks if any of the active filters is a radius filter, return true or false
Kind: static method of MapsDataService
Access: public
Kind: global class
- MapsDataSource
- new MapsDataSource()
- .module.exports
- .data ⇒
null
|array
- .requestOptions
- .mergeData(data) ⇒
null
|array
- .setData(data) ⇒
- .fetch() ⇒
Promise.<array>
- .ensureDetailsFor(ids) ⇒
Promise.<array>
loads and caches data for maps
Kind: static class of MapsDataSource
Param | Type |
---|---|
urlGenerator | function |
requestOptions | Object |
Kind: static property of MapsDataSource
Access: public
requestOptions can contain following keys: method, acceptType, body, formData, transformer
Kind: static property of MapsDataSource
Access: public
Param | Type |
---|---|
requestOptions | Object |
Merges the given array into the current data
Kind: static method of MapsDataSource
Access: public
Param | Type |
---|---|
data | array |
Kind: static method of MapsDataSource
Returns: void
Access: public
Param | Type |
---|---|
data | array |
Fetch all locations. Will use cached data on subsequent calls.
Kind: static method of MapsDataSource
Access: public
Ensures that all given id's contain all detail information. This may trigger a api request.
Kind: static method of MapsDataSource
Access: public
Param | Type |
---|---|
ids | array |