location-picker-field
v1.0.2
Published
A location picker plugin for Payload CMS with Leaflet and address search.
Maintainers
Readme
How to Use location-picker-field Plugin in Your Payload CMS Project
1. Install the Plugin
First, install the plugin in your Payload CMS project:
npm install location-picker-field
# or
yarn add location-picker-field
# or
pnpm add location-picker-field2. Add the Plugin to Your Payload Config
Import and add the plugin to the plugins array in your payload.config.ts (or .js):
import { myLocationField } from 'location-picker-field';
export default {
// ...other config options
plugins: [
myLocationField({
// Plugin options go here
collections: {
posts: true, // Example: enable for 'posts' collection
},
// Add other options as needed
}),
],
};3. Configure Collections
Ensure the collections you want to use the location field with are listed in the plugin options. For example:
myLocationField({
collections: {
posts: true,
events: true,
},
})4. Usage
After setup, the plugin will add a location field to the specified collections. You can now use and manage location data in your Payload admin UI.
5. Development & Customization
- To customize further, refer to the plugin options in the source code or documentation.
- For local development, clone this repo and use the
/devfolder as a test environment.
Need help?
Contact Payload or open an issue in this repository.
