0.5.8 • Published 2 years ago

@gocrisp/react-store-locator v0.5.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@gocrisp/react-store-locator

Package Version MIT License

React version of Crisp's store locator component. Intended for use with the Crisp GeoJSON connector.

This uses the Google Maps JavaScript API to easily create a simple store locator from any GeoJSON source.

Please refer to our example page to see this package in action and for more advanced usage examples. The steps below will provide the minimum for creating a store locator with React.

Create a Store Locator

Set up services

First, go set up a GeoJSON outbound connector on https://platform.gocrisp.com/. It will give you a URL to use later.

Create a Google Maps API Key with the following APIs enabled:

  • Maps JavaScript API
  • Places API
  • Distance Matrix API.
  • Street View Static API

Simple Implementation

Install this package

yarn add @gocrisp/react-store-locator

or

npm install @gocrisp/react-store-locator --save

Include the styles: We have some minimal styles included as plain css in @gocrisp/react-store-locator/dist/react-store-locator.css. You will need to pull this into your site however you are including styles. We've kept the definitions as minimal as possible so that you can easily override or recreate the styles yourself. And every class is namespaced with the map_ prefix to avoid collisions.

Then, wherever you want to include the store locator map, insert this snippet:

import { StoreLocator } from '@gocrisp/react-store-locator';

<StoreLocator 
  geoJson="<URL from the GeoJSON connector>"
  loaderOptions={{ apiKey: '<your Google Maps API key>' }}
/>

Most of the Google Maps JavaScript API options and objects are available for customization as well. More details are available in the examples and documentation.

0.5.8

2 years ago

0.5.7

2 years ago

0.5.4

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago