Base Version of a dealerlocator API
Taken from https://davidwalsh.name/function-debounce
htmlStringhtmlStringReturns: void
| Param | Type |
| --- | --- |
| func | function |
| wait | number |
| immediate | boolean |
htmlString| Param | Type |
| --- | --- |
| html | htmlString |
htmlString| Param | Type |
| --- | --- |
| encode | htmlString |
* DealerLocator
* new DealerLocator()
* .module.exports
* new module.exports(config)
* .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>
DealerLocator #### new module.exports(config)
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 |
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
Kind: static method of DealerLocator
Returns: void
Access: public
| Param | Type |
| --- | --- |
| data | array |
Kind: static method of DealerLocator
Returns: void
Access: public
| Param | Type |
| --- | --- |
| requestOptions | Object |
Kind: static method of DealerLocator
Access: public
Kind: static method of DealerLocator
Access: public
Kind: static method of DealerLocator
Access: public
| Param | Type |
| --- | --- |
| address | string |
| resultRadius | number |
Kind: static method of DealerLocator
Access: public
Kind: static method of DealerLocator
Access: public
Kind: static method of DealerLocator
Access: public
| Param | Type |
| --- | --- |
| resultRadius | number |
| zoom | number |
Kind: static method of DealerLocator
Returns: void
Access: public
| Param | Type |
| --- | --- |
| zoom | number |
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 |
Kind: static method of DealerLocator
Access: public
Kind: static method of DealerLocator
Returns: void
Access: public
Kind: static method of DealerLocator
Access: public
| Param | Type |
| --- | --- |
| key | string |
| value | any |
Kind: static method of DealerLocator
Access: public
| Param | Type |
| --- | --- |
| key | string |
| value | any |
Kind: static method of DealerLocator
Access: public
| Param | Type |
| --- | --- |
| radius | number |
Kind: static method of DealerLocator
Access: public
| Param | Type |
| --- | --- |
| type | string |
* GoogleMap
* new GoogleMap()
* .module.exports
* new module.exports(apiKey, mapContainer, hasCluster, hasCustomResults, mapsDataService, resultEl, resultsContainer, configOptions)
* .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>
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 |
GoogleMap | Param | Type |
| --- | --- |
| | Object.<(lat\|lng), number> |
GoogleMap GoogleMap GoogleMap Kind: static method of GoogleMap
Returns: void
Access: public
Kind: static method of GoogleMap
Access: public
| Param | Type |
| --- | --- |
| marker | google.maps.Marker |
| template | string |
Kind: static method of GoogleMap
Access: public
| Param | Type |
| --- | --- |
| templateContainer | string |
| | Object.<(properties.<Object>\|id)> |
Kind: static method of GoogleMap
Returns: htmlString - tmpl
Access: public
| Param | Type |
| --- | --- |
| tmpl | htmlString |
| templateVar | string |
| delimiters | array |
| properties | object |
Kind: static method of GoogleMap
Returns: void
Access: public
Kind: static method of GoogleMap
Returns: void
Access: public
| Param | Type |
| --- | --- |
| zoom | number |
GoogleMap Kind: static method of GoogleMap
Access: public
Kind: static method of GoogleMap
Access: public
| Param | Type |
| --- | --- |
| address | string |
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 |
* MapsDataService
* new MapsDataService()
* .module.exports
* new module.exports(mapsDataSource, computeDistanceBetweenPoints)
* .maxResults
* .getItems() ⇒ Promise.<undefined>
* .setData(data) ⇒
* .addFilterFor(propName, propValue) ⇒
* .removeFilterFor(propName, propValue) ⇒
* .addRadiusFilterFor(center, radius) ⇒
* .removeFilterType(type) ⇒
* .resetFilters() ⇒
* .ensureDetailsFor(ids) ⇒ Promise.<array>
* .hasActiveRadiusFilter() ⇒ boolean
MapsDataService #### new module.exports(mapsDataSource, computeDistanceBetweenPoints)
Creates an instance of MapsDataService.
| Param | Type |
| --- | --- |
| mapsDataSource | MapsDataSource |
| computeDistanceBetweenPoints | function \| undefined |
MapsDataService | Param | Type |
| --- | --- |
| max | number |
Kind: static method of MapsDataService
Access: public
Kind: static method of MapsDataService
Returns: void
Access: public
| Param | Type |
| --- | --- |
| data | array |
Kind: static method of MapsDataService
Returns: void
Access: public
| Param | Type |
| --- | --- |
| propName | string |
| propValue | any |
Kind: static method of MapsDataService
Returns: void
Access: public
| Param | Type |
| --- | --- |
| propName | string |
| propValue | any |
Kind: static method of MapsDataService
Returns: void
Access: public
| Param | Type |
| --- | --- |
| center | number |
| radius | number |
Kind: static method of MapsDataService
Returns: void
Access: public
| Param | Type |
| --- | --- |
| type | string |
Kind: static method of MapsDataService
Returns: void
Access: public
Kind: static method of MapsDataService
Access: public
| Param | Type |
| --- | --- |
| ids | any |
Kind: static method of MapsDataService
Access: public
* MapsDataSource
* new MapsDataSource()
* .module.exports
* new module.exports(urlGenerator, requestOptions)
* .data ⇒ null \| array
* .requestOptions
* .mergeData(data) ⇒ null \| array
* .setData(data) ⇒
* .fetch() ⇒ Promise.<array>
* .ensureDetailsFor(ids) ⇒ Promise.<array>
MapsDataSource #### new module.exports(urlGenerator, requestOptions)
| Param | Type |
| --- | --- |
| urlGenerator | function |
| requestOptions | Object |
MapsDataSource Kind: static property of MapsDataSource
Access: public
| Param | Type |
| --- | --- |
| requestOptions | Object |
Kind: static method of MapsDataSource
Access: public
| Param | Type |
| --- | --- |
| data | array |
MapsDataSource | Param | Type |
| --- | --- |
| data | array |
Kind: static method of MapsDataSource
Access: public
Kind: static method of MapsDataSource
Access: public
| Param | Type |
| --- | --- |
| ids | array |