gsarig / ootb-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. 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/
29 stars 2 forks source link

Support for separate icon per marker #16

Closed gsarig closed 1 year ago

gsarig commented 1 year ago

Allow overriding the global marker icon on specific locations.

nathanaelhoun commented 1 year ago

I would be very happy to have this feature! Would you take a PR for this? (I never developed for Wordpress but it could be fun to try)

gsarig commented 1 year ago

Hi @nathanaelhoun Thanks for the offer. I had already started working on this feature, and if you want to try it before it gets deployed, you can check out release/2.3.0.

Related PR: https://github.com/gsarig/ootb-openstreetmap/pull/25

If all goes well, this will be pushed to master next weekend (March 11-12).

nathanaelhoun commented 1 year ago

Hey @gsarig, impressive work, thanks! I tested it on a copy of my website and it looks great!

I had one surprise: the image I used was pretty big (600 px * 1500 px) and it appeared enormous on the map. It was so big that I had some troubles to select it again or any other pin to put the image back. I kinda expected that a resize method would be available but I didn't find it.

I eventually managed to replace it with a smaller version (23px*50px) and it looks great :-)

gsarig commented 1 year ago

Thanks for testing @nathanaelhoun I know what you mean about the image size, but I preferred to omit any style modification or force a specific size, and, instead, leave it entirely up to the user to upload any size they want.

gsarig commented 1 year ago

This is now deployed with version 2.3.0.

nathanaelhoun commented 1 year ago

Thanks @gsarig! Much appreciated!