Giter Site home page Giter Site logo

goiblas / map-block-leaflet Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 10.0 9.96 MB

Map Block Leaflet for WordPress 🗺️

Home Page: https://wordpress.org/plugins/map-block-leaflet

License: GNU General Public License v2.0

CSS 23.51% JavaScript 57.30% PHP 13.97% SCSS 5.22%
wordpress wordpress-plugin gutenberg-blocks

map-block-leaflet's People

Contributors

daviewales avatar dependabot[bot] avatar goiblas avatar liqueurdetoile avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

map-block-leaflet's Issues

Map Block Leaflet 1.5 doesn't load.

After upgrading to version 1.5, Wordpress seems unable to detect this plugin.

Specifically, the plugin appears to be installed and activated, but I am unable to find it in the list of blocks. Blocks added with a previous version of the plugin no longer work.

Map Height Not Remembered in Block Settings

After setting "Options > Map Height" and Publishing/Updating the Post/Page the Map does use correct height, but if you edit the Page/Post the Map Height reverts to "220".

So if you edit something on the page and Update, the Map height reverts.

Guessing the current map height is not checked when editing the Post/Page?

Allow newlines in tooltip text

It would be nice to be able to display newlines within the tooltip.

For example, this could be achieved by the wrapping the tooltip text in <p> tags, and replacing newlines with <br>.

Icon map don't show

Hello,
the icon marker does not show on the map on the front end.
The map try to load the png from the url of the page.
GET https://gargas-dev-front.149-202-93-199.plesk.page/fr/infos-pratiques/**marker-shadow.png**

Thank you for your work.

Add option to customise text displayed in marker

Currently, the Leaflet marker displays the address which was entered to locate the marker.

It would be nice to be able to change what is displayed in the marker without changing the location of the marker.

Content of tooltip is not properly escaped.

The contents of the tooltip are inserted directly into the page without proper escaping. This means that including quotation marks breaks the loading and rendering of the map. Additionally, inserting a newline also breaks rendering.

It also means that by setting the value of the tooltip as follows, arbitrary javascript can be inserted into the page:

');alert('hi');console.log('unescaped arbitrary code execution!

(You should see an alert, and an entry in the console.)

map_block_leaflet_render() disabled?

It seems that "map_block_leaflet_render()" is removed, is there a replacement? I have used it to fill in a custom map by code from custom meta.

Thanks for all the work.

Improve the theme selector

change the theme through thumbnail of maps

  • Generate thumbnails
  • Add to providers array
  • Create a new component picker
  • Integrate into inspector

Javascript code gets wrapped in <p>

For some reason Wordpress auto-wraps parts of the Javascript code in <p> Tags. Any tips what I can try to clear this up? I have a current version of WP and your plugin. The content gets no special treatment and is just output with the_content().

Screenshot 2020-06-05 at 17 19 30

This of course causes an error and the map never shows on the page.

Update:

I do in fact process the blocks, by passing them through render_block() inside add_filter('the_content', …). I disabled that and the map shows up fine. I don't know why that would be different than what Wordpress does during render anyway, but it fixed the issue. Luckily, I was in a position where removing the filter was possible.

Disable assets if block isn't in page

The assets is in all pages. For the moment i use this snippet for remove assets if the block isn't in page.

/**
 * Completely remove assets from plugin block leaflet if isn't in page
 */
function disableLeafletAsset()
{
  $id = get_the_ID();
  if (!has_block('map-block-leaflet/map-block-leaflet', $id)) {
    wp_dequeue_script('lib-js-map-block-leaflet');
    wp_dequeue_script('lib-js-map-block-leaflet-cluster');
    wp_dequeue_script('js-editor-map-block-leaflet');

    wp_dequeue_style('css-editor-map-block-leaflet');
    wp_dequeue_style('lib-css-map-block-leaflet');
    wp_dequeue_style('lib-css-map-block-leaflet-cluster');
  }
}


add_action('wp_enqueue_scripts', 'disableLeafletAsset');

Inner map tile is not set up correctly in full-width mode

Hi,

Thanks for this great plugin.

On a currently in-dev site (using Hestia theme), I'm willing to load a full-width map on a page by using the dedicated option from block toolbar.

On frontend, the container is well updated to expand to full-width through negative left/right margins but the inner map tile is stuck to initial width and there's a grayed empty area.

If I force a new rendering, by resizing window for instance, map tile expands correctly to fill all container.

Is it fixable ?

Thanks !

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.