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

strapi-geodata

v0.1.2

Published

geo data

Downloads

757

Readme

Strapi GeoData

Strapi GeoData is a plugin that enhances Strapi's functionality by adding latitude, longitude, geohash, and a convenient map.

❗ Requirements

Strapi v5

How It Works

The operation is simple: by adding the custom field to a collection, a map and two control fields will be created.

To add a marker, you can either enter the latitude and longitude directly and then click "Set Location", search for an address and click "Search", or move around the map and right-click to place a marker.

Admin Image

The JSON field is not editable; it simply displays the values that will be saved.

The values stored in the JSON field are not very useful for filtering results, but you can create three fields: lat, lng, and geohash. When saving an item, these three fields will be automatically populated and can then be used for queries.

Important: The fields must be structured as follows:

{ "lat": float, "lng": float, "geohash": string }

If you want to update or create an item in the collection and set the location, do not modify the three fields lat, lng, and geohash (if created) directly. Always write the geohash field in the format:

{ "lat": float, "lng": float }

The values will then be automatically written to the three fields.

🚀 Strapi Configuration (Required) To allow all Maps assets to load correctly, customize the strapi::security middleware inside ./config/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/",
          ],
        },
      },
    },
  },  
  // ...
];

(Thanks to the developers at strapi-leaflet-geoman for the tip!)

Install Now

To install the plugin, run the following commands:

npm install strapi-geodata
yarn add strapi-geodata