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.
- 🗺 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!
- Strapi v5
# npm
npm install strapi-location-picker
# yarn
yarn add strapi-location-picker
# pnpm
pnpm install strapi-location-pickerAfter installation, enable the plugin and customize the strapi::security middleware inside ./config/middlewares.js
Instead of:
export default [
// ...
'strapi::security',
// ...
];Write:
middlewares.js
export default [
// ...
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
"connect-src": ["'self'", "https:"],
"script-src": [
"'self'",
"unsafe-inline",
"https://*.basemaps.cartocdn.com",
],
"media-src": [
"'self'",
"blob:",
"data:",
"https://*.basemaps.cartocdn.com",
"https://tile.openstreetmap.org",
"https://*.tile.openstreetmap.org",
],
"img-src": [
"'self'",
"blob:",
"data:",
"https://*.basemaps.cartocdn.com",
"market-assets.strapi.io",
"https://*.tile.openstreetmap.org",
"https://unpkg.com/[email protected]/dist/images/",
],
},
},
},
},
// ...
];This plugin simplifies location management in your Strapi project, making it easier to store and manage geographic data without any hassle.
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:
{
"attributes": {
"[your_location_field]": {
"type": "json",
"required": true
}
}
}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.