Open Street Maps Implementation#643
Conversation
PR Summary
These changes improve the product by enhancing its functionality, aesthetics, performance and including new features like map embedding. |
|
We'll also need to add Leaflet to docs, see #610 |
|
I re-read this issue again today and stumbled upon:
Who should go on with the work to do? |
|
Thanks. |
|
@MervinHernandez all things you saw fail should be fixed now. |
| profile: path.resolve(process.cwd(), 'src/profile', 'index.js'), | ||
| profile_style: path.resolve(process.cwd(), 'src/profile', 'style.scss'), | ||
| }, | ||
| module: { |
There was a problem hiding this comment.
I might change this rule to be explicit for marker-icon-2x.png and marker-shadow.png. These are the only 2 images that cannot get a hash or Leaflet will not work. I'll play with it a bit, but this is fine for right now.
|
@stephenerdelyi @jmarx the data needs to be updated (latitude, longitude, address) need to meet the Geodata Format in ticket 561 https://codex.wordpress.org/Geodata#Geodata_Format Details are in ticket #560 (cc @carstingaxion @MervinHernandez) EDIT: This actually should be pretty easy. We can keep things as they are, but create a pseudo post meta function to retrieve the data from our serialized meta we use for gatherpress venue. I can probably take a look at this if you all wish. |
|
Is testing in the playground using this PR loading the latest commit? If yes, just done a test (20240721 06:15 UTC), happening in both Firefox and Chrome, and only with OSM, not with Google Maps. When a map height is expanded, it gets a grey area (after about 370px), this solves as soon as we either resize the browser, or change the Zoom level in the block |
As an example, I created such a pseudo-post-meta-getter while working on the new Venue Website block AND over here (#560 (comment)), which worked, but have been criticised by @shawfactor for good reasons here. \add_filter(
'get_post_metadata',
function ( $metadata, $object_id, $meta_key ): mixed {
if ( 'venue_information_website' !== $meta_key ) {
return $metadata;
}
$venue_information = (array) json_decode( get_post_meta( $object_id, 'gatherpress_venue_information', true ) );
return [
( isset( $venue_information['website'] ) ) ? $venue_information['website'] : '',
];
},
10,
3
); |
|
How to handle that post_meta and when to do it is more a strategic descision, I guess. Currently I'm building the new blocks for Venue Website, Venue Address and ... as singular |
…ge; started work on geodata but having issues with it.
@carstingaxion this might be better. Using the filter has become challenging. I committed as far as I got with it, but maybe these should all just be singular post meta matching geodata format wordpress is looking for. |
Yes, please. Let's not reinvent the wheel, and use post_meta for what it is made for. And because this would be a close-to-core route, GatherPress can make use of some more core APIs a little more easily. Like the core-data store in JS or native Editing for the Block Bindings API in php, which will be especially interesting for the venue address and venue phone data. |
@patriciabt this should be fixed now. Good catch!! |
| ); | ||
| } | ||
|
|
||
| public function sanitize_float( $value ) { |
There was a problem hiding this comment.
Probably good to move some of these sanitization utilities to Utility class where they can be used in various places that needs same kind of sanitization.
So the post meta will be as follows for venue, correct?
EDIT: Now that I'm thinking about it, do we just want to remove phone number and website from the block entirely? Those things can be added to the venue post as text if someone wants to add them. I'm just wondering if there's any real value at this point to storing that data as meta? Let me know what you think @carstingaxion. |
|
I'm totally fine with your suggested post_meta @mauteri , like I described in #560. Like also described over there, I would bind And yes, I would also keep venue-website and venue-phone as separate post meta. I can imagine some use-cases where either one of them or both seem useful. |
✅ TEST Latest open-street-maps Branch on GP✅ Setup Test✅ INSTALL Latest GP Branch on DEV ✅ TEST Open Street Maps
✅ TEST Open Street Maps - Settings
✅ TEST BUGFIXES - July 27✅ RESOLVED = 0727-01 Map Location Indicator = not visible in editor window 🐞 BUGFIXES That Remain |




Description of the Change
This PR addresses the addition of Open Street Maps in Gatherpress. This is a working draft for the OSM team to develop on.

Closes #561
How to test the Change
This change can be tested by viewing any event page with a venue containing a location. You should immediately see the OSM version of the map.
In Progress:
Changelog Entry
Credits
@stephenerdelyi, @jmarx, @mauteri
Checklist: