Package Exports
- address-autocomplete-react
- address-autocomplete-react/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (address-autocomplete-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-photon-location-input
This is a React component that provides an autosuggest input box using the Photon API for location search with OpenStreetMap data. It returns the selected location's name and coordinates.
Installation
Install the component via npm:
npm install address-autocomplete-react
LiveDemo
Click here to see it in action
Usage
import React, { useState } from "react";
import LocationInput from "address-autocomplete-react";
const MyApp = () => {
const [coords, setCoords] = useState(null);
const handleLocationSelect = (location) => {
setCoords([location.lat, location.lon]);
console.log("Selected location:", location);
};
return (
<div>
<LocationInput
placeholder="Enter Drop Location..."
onLocationSelect={handleLocationSelect}
/>
{coords && <p>Selected coordinates: {coords.join(", ")}</p>}
</div>
);
};
export default MyApp;