Skip to content

Commit

Permalink
Merge branch 'release/2.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gsarig committed Mar 11, 2023
2 parents 534ee80 + 66c45d3 commit 7bff82c
Show file tree
Hide file tree
Showing 18 changed files with 1,192 additions and 1,068 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Drawing a polyline:

* No need for API keys. Just install and use it.
* Support for multiple markers.
* Support for a different icon per marker.
* Support for polygons and polylines.
* [Dead-simple interface](https://www.gsarigiannidis.gr/wordpress-gutenberg-map-block-openstreetmap/). 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](https://www.gsarigiannidis.gr/openstreetmap-place-search/). Find locations by typing keywords.
Expand All @@ -37,7 +38,9 @@ Drawing a polyline:
* 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.
* Support for other Layer Providers: MapBox (using your own API key) and Stamen.
* Option to export locations in a JSON file
* Option to import locations from a JSON file

## Installation

Expand Down
6 changes: 5 additions & 1 deletion assets/ootb-openstreetmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@

// Render a location's marker
function renderLocation(location) {
const markerIcon = structuredClone(defaultIcon);
if (location.icon) {
markerIcon.iconUrl = location.icon.url;
}
let marker = L.marker([location.lat, location.lng], {
icon: L.icon(defaultIcon),
icon: L.icon(markerIcon),
});
if (location.text) {
marker.bindPopup(location.text);
Expand Down
2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'b02df17e5e9500f32cdc');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '0f09fbe4f272915adcb9');
2 changes: 1 addition & 1 deletion build/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -657,5 +657,5 @@ svg.leaflet-image-layer.leaflet-interactive path {
}
}

.block-editor-block-list__block[data-type="ootb/openstreetmap"]{z-index:1}.block-editor-block-list__block[data-type="ootb/openstreetmap"].is-selected .ootb-openstreetmap--search-results{opacity:1;top:48px}.block-editor-block-list__block[data-type="ootb/openstreetmap"].is-selected .ootb-openstreetmap--searchbox{opacity:1;top:.5rem}.wp-block-ootb-openstreetmap{position:relative}.wp-block-ootb-openstreetmap.pinning .leaflet-container,.wp-block-ootb-openstreetmap.pinning .leaflet-container .leaflet-marker-pane img{cursor:crosshair}.wp-block-ootb-openstreetmap .leaflet-popup-content{width:150px}.wp-block-ootb-openstreetmap .leaflet-popup-content p{font:8px Helvetica Neue,Arial,Helvetica,sans-serif;margin:.5em 0}.wp-block-ootb-openstreetmap .leaflet-marker-icon{animation:animate-marker .4s ease-in-out;top:0}.ootb-openstreetmap--icon{border:2px dashed #ddd;margin-bottom:.5rem;text-align:center}.ootb-openstreetmap--icon img{margin:.5rem auto}.gmp-openstreetmap--buttons{border-top:1px solid #ddd;display:flex;justify-content:space-around;margin:0 .5rem;padding:.7rem 0}.ootb-openstreetmap--marker-remove{background:#f5f5f5;border:1px solid #eee;border-radius:5px;text-align:center}.ootb-openstreetmap--marker-remove svg.dashicon{fill:#b52727}.ootb-openstreetmap--alert{background:rgba(0,0,0,.6);border-radius:5px;bottom:1em;color:#fff;font-size:13px;left:1em;padding:.5em;position:absolute;text-align:center;width:calc(100% - 2em);z-index:9999}.ootb-openstreetmap--searchbox{background:#fff;border:1px solid #1e1e1e;color:#444;display:flex;max-width:calc(100% - 5rem);opacity:0;padding:0 0 0 .5rem;position:absolute;right:.5rem;top:0;transition:all .2s ease-in-out;width:280px;z-index:999}.ootb-openstreetmap--searchbox>div{flex:1}.ootb-openstreetmap--searchbox .components-base-control__field{margin-bottom:0}.ootb-openstreetmap--searchbox .components-text-control__input[type=text]{background:transparent;border:none;box-shadow:none;color:#000}.ootb-openstreetmap--searchbox svg.dashicon{fill:#000}.block-editor-block-list__block[data-type="ootb/openstreetmap"] .ootb-openstreetmap--search-results{background:#fff;border:1px solid #1e1e1e;max-height:calc(100% - 70px);max-width:calc(100% - 5rem);opacity:0;overflow-y:auto;position:absolute;right:.5rem;text-align:left;top:0;transition:all .2s ease-in-out;width:280px;z-index:999}.block-editor-block-list__block[data-type="ootb/openstreetmap"] .ootb-openstreetmap--search-results .components-button{height:auto;text-align:left;width:100%}@keyframes animate-marker{0%{top:-60px}50%{top:0}90%{top:-10px}to{top:0}}.wp-block-create-block-ootb-openstreetmap{border:1px dotted red}
.block-editor-block-list__block[data-type="ootb/openstreetmap"]{z-index:1}.block-editor-block-list__block[data-type="ootb/openstreetmap"].is-selected .ootb-openstreetmap--search-results{opacity:1;top:48px}.block-editor-block-list__block[data-type="ootb/openstreetmap"].is-selected .ootb-openstreetmap--searchbox{opacity:1;top:.5rem}.wp-block-ootb-openstreetmap{position:relative}.wp-block-ootb-openstreetmap.pinning .leaflet-container,.wp-block-ootb-openstreetmap.pinning .leaflet-container .leaflet-marker-pane img{cursor:crosshair}.wp-block-ootb-openstreetmap .leaflet-popup-content{width:150px}.wp-block-ootb-openstreetmap .leaflet-marker-icon{animation:animate-marker .4s ease-in-out;top:0}.ootb-openstreetmap--icon{border:2px dashed #ddd;margin-bottom:.5rem;text-align:center}.ootb-openstreetmap--icon img{margin:.5rem auto}.gmp-openstreetmap--buttons{border-top:1px solid #ddd;display:flex;justify-content:space-around;margin:0 .5rem;padding:.7rem 0}.ootb-openstreetmap--alert{background:rgba(0,0,0,.6);border-radius:5px;bottom:1em;color:#fff;font-size:13px;left:1em;padding:.5em;position:absolute;text-align:center;width:calc(100% - 2em);z-index:9999}.ootb-openstreetmap--marker-icon-container{align-items:flex-end;border-top:1px solid #ccc;display:flex;flex-wrap:wrap;justify-content:flex-end;margin-top:1rem;padding-top:.2rem}.ootb-openstreetmap--marker-icon-container .gmp-openstreetmap--buttons .dashicon:before{font-size:16px}.leaflet-popup-content-wrapper .ootb-openstreetmap--icon{align-items:flex-end;border:none;display:flex;flex:1;justify-content:space-between;margin-bottom:0}.leaflet-popup-content-wrapper .gmp-openstreetmap--buttons{border-top:none;margin:0;padding:0}.leaflet-popup-content-wrapper .components-button{box-shadow:none}.ootb-openstreetmap--searchbox{background:#fff;border:1px solid #1e1e1e;color:#444;display:flex;max-width:calc(100% - 5rem);opacity:0;padding:0 0 0 .5rem;position:absolute;right:.5rem;top:0;transition:all .2s ease-in-out;width:280px;z-index:999}.ootb-openstreetmap--searchbox>div{flex:1}.ootb-openstreetmap--searchbox .components-base-control__field{margin-bottom:0}.ootb-openstreetmap--searchbox .components-text-control__input[type=text]{background:transparent;border:none;box-shadow:none;color:#000}.ootb-openstreetmap--searchbox svg.dashicon{fill:#000}.block-editor-block-list__block[data-type="ootb/openstreetmap"] .ootb-openstreetmap--search-results{background:#fff;border:1px solid #1e1e1e;max-height:calc(100% - 70px);max-width:calc(100% - 5rem);opacity:0;overflow-y:auto;position:absolute;right:.5rem;text-align:left;top:0;transition:all .2s ease-in-out;width:280px;z-index:999}.block-editor-block-list__block[data-type="ootb/openstreetmap"] .ootb-openstreetmap--search-results .components-button{height:auto;text-align:left;width:100%}@keyframes animate-marker{0%{top:-60px}50%{top:0}90%{top:-10px}to{top:0}}.wp-block-create-block-ootb-openstreetmap{border:1px dotted red}
.ootb-openstreetmap--map{width:100%}.ootb-openstreetmap--map .leaflet-popup-content{width:150px}.ootb-openstreetmap--map .leaflet-popup-content p{margin:.5em 0}
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ootb-openstreetmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: A map block for the Gutenberg Editor using OpenStreetMaps and Leaflet that needs no API keys and works out of the box.
* Requires at least: 5.8.6
* Requires PHP: 7.4
* Version: 2.2.0
* Version: 2.3.0
* Author: Giorgos Sarigiannidis
* Author URI: https://www.gsarigiannidis.gr
* License: GPL-2.0-or-later
Expand All @@ -21,7 +21,7 @@
define( 'OOTB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );

const OOTB_BLOCK_NAME = 'ootb/openstreetmap';
const OOTB_VERSION = '2.2.0';
const OOTB_VERSION = '2.3.0';
const OOTB_PLUGIN_INC = OOTB_PLUGIN_PATH . 'includes/';

// Require Composer autoloader if it exists.
Expand Down
Loading

0 comments on commit 7bff82c

Please sign in to comment.