Strapi Location Picker
Strapi plugin for selecting and searching locations with an interactive map picker.
Strapi Location Picker
Easily add location selection to your Strapi project!
The Strapi Location Picker plugin lets you integrate a smooth and intuitive location picker into your Strapi admin panel. Perfect for projects that require geolocation data, such as stores, events, user profiles, or delivery services.
✨ Features
- 🗺 Interactive Map Picker – Select locations with a simple click.
- 🔍 Searchable Maps – Quickly find locations by searching addresses or place names.
- ✅ Seamless Strapi Integration – Works natively with your content types.
- 🚀 Easy Installation – Get started in minutes!
Preview
❗ Requirements
- Strapi v5
🚀 Installation
# npm
npm install strapi-location-picker
# yarn
yarn add strapi-location-picker
# pnpm
pnpm install strapi-location-picker
🛠️ Configuration
After installation, enable the plugin and customize the strapi::security
middleware inside ./config/middlewares.js
Instead of:
1export default [
2 // ...
3 'strapi::security',
4 // ...
5];
Write:
middlewares.js
1export default [
2 // ...
3 {
4 name: 'strapi::security',
5 config: {
6 contentSecurityPolicy: {
7 useDefaults: true,
8 directives: {
9 "connect-src": ["'self'", "https:"],
10 "script-src": [
11 "'self'",
12 "unsafe-inline",
13 "https://*.basemaps.cartocdn.com",
14 ],
15 "media-src": [
16 "'self'",
17 "blob:",
18 "data:",
19 "https://*.basemaps.cartocdn.com",
20 "https://tile.openstreetmap.org",
21 "https://*.tile.openstreetmap.org",
22 ],
23 "img-src": [
24 "'self'",
25 "blob:",
26 "data:",
27 "https://*.basemaps.cartocdn.com",
28 "market-assets.strapi.io",
29 "https://*.tile.openstreetmap.org",
30 "https://unpkg.com/leaflet@1.9.4/dist/images/",
31 ],
32 },
33 },
34 },
35 },
36 // ...
37];
📌 Why Use Strapi Location Picker?
This plugin simplifies location management in your Strapi project, making it easier to store and manage geographic data without any hassle.
⚙️ Advanced Usage
Set as a Required Field
To make the location field mandatory in your content type, update your model schema in
./src/api/[your-model]/content-types/[your-model]/schema.json
Make sure the required
value is true:
1{
2 "attributes": {
3 "[your_location_field]": {
4 "type": "json",
5 "required": true
6 }
7 }
8}
🙌 Credits
This plugin is built upon existing work and contributions from the open-source community. Special thanks to previous developers and contributors whose work helped shape this plugin.
Install now
npm install strapi-location-picker
Create your own plugin
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.