Giter VIP home page Giter VIP logo

skorasaurus / ootb-openstreetmap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gsarig/ootb-openstreetmap

0.0 0.0 0.0 23.05 MB

A map block for WordPress' Gutenberg Editor which uses OpenStreetMap and Leaflet.js. It needs no API keys and works out of the box. Benefiting from Gutenberg’s potential, the plugin tries a different take on how to add your locations on the map and rethinks a few things, UX-wise. Install it from https://wordpress.org/plugins/ootb-openstreetmap/

JavaScript 52.63% PHP 20.41% CSS 26.81% SCSS 0.15%

ootb-openstreetmap's Introduction

Download from WordPress.org

Out of the Block: OpenStreetMap

A map block for WordPress' Gutenberg Editor which uses OpenStreetMap and Leaflet.js. It needs no API keys and works out of the box (or, out of the Block, if you prefer). Benefiting from Gutenberg's potential, the plugin tries a different take on how to add your locations on the map and rethinks a few things, UX-wise.

Instead of manually adding coordinates for each one of your markers, just click-and-drop them directly on the map. You want to adjust their position? Just drag them wherever you want. And instead of filling-in custom fields to set each marker's popup content, just open that popup and start writing in it, the Gutenberg way (it supports WYSIWYG editing, with links, images, and all). It even stores the map's zoom level as you use it so that you don't have to set it by hand.

👉 Read more about the overall UX challenges

Demo GIF

👉 The challenges of building a user-friendly place search for OpenStreetMap

Demo GIF

Drawing a polygon:

Demo GIF

Drawing a polyline:

Demo GIF

Features

  • No need for API keys. Just install and use it.
  • Support for multiple markers.
  • Support for polygons and polylines.
  • Dead-simple interface. Don't search for coordinates and don't get overwhelmed by too many fields when using multiple markers. Just point and click on the map to add your marker where you want it and edit it's popup content directly from there.
  • Place search. Find locations by typing keywords.
  • Remembers the zoom that you set when adding the markers and stores it so that you don't set it by hand (which you can do anyway if you prefer).
  • Adjust the map height.
  • Change the default marker icon with a custom one.
  • Enable or disable map dragging.
  • Enable or disable touch zoom.
  • Enable or disable double-click zoom.
  • Enable or disable scroll wheel zoom.
  • Set a minimum and maximum limit that the user can zoom on the frontend. Setting the same value to both fields will lock the zoom at that level.
  • Support for MapBox, as an additional Layer Provider, using your own API key.

Installation

  1. Upload the plugin to your WordPress plugins directory and activate it.
  2. That's it. You can go to a post/page that supports the Gutenberg editor and start using the block called "Out of the Block: OpenStreetMap"

Frequently Asked Questions

Do I need an API key, like with Google Maps?

No.

That's the point actually. Just install the plugin and start adding maps.

How do I add a new location?

To add a location, left-click on the map for a while, until you see the prompt saying "Release to drop a marker here". On browsers that support it, the cursor transforms from hand to crosshair, to make it even more apparent. As long as the prompt is visible, it means that releasing the click will drop the marker at that spot. That slight delay has been added to prevent you from accidentally adding markers all over the place with every click.

How do I remove a location?

Click on the marker to open up its popup. There, you will see the "Remove" button.

I can't find some of the options like disable dragging, setting zoom levels, etc

Check under the "Map behavior" section, at the blocks' settings at the sidebar on the right. It's toggled off by default, that's probably why you missed it.

Screenshots

The map editing screen The map editing screen

Map behavior options Map behavior options

Adding a marker Adding a marker

Using custom markers Using custom markers

Place search Place search

ootb-openstreetmap's People

Contributors

gsarig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.