npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-google-geocoder

v0.2.0

Published

Google GeoCoding Input

Downloads

25

Readme

react-google-geocoder

License

Copyright (c) 2014-2018 Mike Baranski http://www.mikeski.net

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

react-google-geocoder gives you a text input that allows input validation and geo-location of an address via the Google Geo Location API.

If there are multiple results returned, they are displayed as a list and one can be selected. Once a unique address is located, the component will call a callback with all of the available address information.

See the demo https://mikebski.github.io/react-google-geocoder-demo/

Installation

Install using NPM:

npm install react-google-geocoder --save

You need to get a Google API credential that has GeoCoding enabled. See https://developers.google.com/maps/documentation/geocoding/get-api-key for information on how to get a key.

Note on Credential

For local development with an npm server, for some reason this setup requires a "server" key instead of a credential that is restricted by referrer. If you get errors about needing server credentials without referrer restrictions, generate a new server credential.

Usage

Minimal usage is something like this:

<GeoCoder apiKey="REPLACE_WITY_YOUR_GOOGLE_API_KEY"/>

See the Options below for all available options

Options

|Property|Type|Default Value|Description| |--------|----|-----------|-------------| |apiKey|PropTypes.string.isRequired|None|Your Google API key| |searchButtonLabel|PropTypes.string|Search|Label for "Search" button| |resetButtonLabel|PropTypes.string|Reset|Label for "Reset" button| |selectButtonLabel|PropTypes.string|Select|Label for "Select" button| |acceptButtonLabel|PropTypes.string|Accept|Label for "Accept" button| |searchButtonClass|PropTypes.string|geo-code-button geo-code-search-button|CSS class for "Search" button| |resetButtonClass|PropTypes.string|geo-code-button geo-code-reset-button|CSS class for "Reset" button| |selectButtonClass|PropTypes.string|geo-code-button geo-code-select-button|CSS class for "Select" button| |acceptButtonClass|PropTypes.string|geo-code-button geo-code-accept-button|CSS class for "Accept" button| |errorMessage|PropTypes.string|There was an error|Error message text| |errorMessageClass|PropTypes.string|geo-code-error|CSS class for error message| |formTitle|PropTypes.string|Search for Address|Title of form| |showFormTitle|PropTypes.bool|true|Should show form title?| |formClass|PropTypes.string|geo-code-form|CSS class for form| |tableClass|PropTypes.string|geo-code-table|CSS class for address list table| |fieldLabel|PropTypes.string|Address|Label for address field| |inputLabelWrapperClass|PropTypes.string|geo-code-input-and-label|CSS class for input and label wrapper| |formButtonWrapperClass|PropTypes.string|geo-code-form-button-wrapper|CSS class for wrapper for form buttons| |inputClass|PropTypes.string|geo-code-input|CSS class for input| |labelClass|PropTypes.string|geo-code-label|CSS class for label| |onAddressAccept|PropTypes.func| (value) => alert("Accepted: " + JSON.stringify(value))|Method to call when "Accept" is clicked, this gets passed the address information| |input|PropTypes.element|GeoCoderInput|Input to use for the form| |searchButton|PropTypes.element|GeoCoderSearchButton|Search button to use for the form| |input|PropTypes.element|GeoCoderInput|Input to use for the form, see the demo page for how to do this| |searchButton|PropTypes.element|GeoCoderSearchButton|Button to use for search| |resetButton|PropTypes.element|GeoCoderResetButton|Button to use for reset| |acceptButton|PropTypes.element|GeoCoderAcceptButton|Button to use for accept| |selectButton|PropTypes.element|GeoCoderSelectButton|Button to use for select|

Help

Create an issue here for help