Giorgos Sarigiannidis
Forum Replies Created
-
Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] Mapbox: No map showingHi Ralf,
Before diving into Mapbox-specific debugging, it’s worth confirming that the map works with the default
OpenStreetMap provider. If you see a grey map there too, the issue is unrelated to Mapbox (could be a JavaScript conflict, a caching plugin, or a theme issue).Assuming the default provider works fine, a grey map with Mapbox usually comes down to one of three things:
- Style URL format
The plugin expects the Mapbox protocol URL, not the browser URL. In Mapbox Studio, click “Share” on your style and copy the Style URL. it should look like this:mapbox://styles/your-username/your-style-id
If you copied the page URL from your browser (starting with https://), that won’t work. - Access token
Make sure you’re using a public token (starts with pk.), not a secret one. You can find and create tokens at mapbox.com/account/access-tokens. The default public token on your account works fine for this. - Selecting Mapbox as the provider in the block
The API key and style URL in the plugin settings are the global defaults, but each block still needs to have Mapbox explicitly selected as its provider. Open the block in the editor, go to the block settings in the sidebar, and make sure “MapBox” is selected as the map provider. If it’s still set to OpenStreetMap, it will ignore the Mapbox settings entirely. If none of the above helps, open your browser’s developer console (F12 → Network tab) and reload the page. Look for failing tile requests. The error message there will tell you exactly what’s wrong (invalid token, wrong URL format, billing issue, etc.), and that would be the thing to take to Mapbox support if needed.
Hope that helps!
Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] ClusteringHi @nummernegen
This has been implemented in version 2.11.0
There is a new toggle “Cluster markers” under the “Map Behavior” section, which activates clustering on the frontend.
If you need to pass specific parameters to the clustering script, you can use the available hook.
Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] Can Map Locations / Pins be filtered?Hi,
I’m not sure that I understand exactly what you have in mind. The plugin doesn’t have any backed-in functionality to search or filter the results. Since version 2.8.0 it supports custom fields, though, so you could utilize it to implement some filtering functionality in your theme. I’m not familiar with FacetWP so I don’t know exactly how it works, but since its just standard WordPress custom fields, it might be relatively straightforward.
Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] No wide/full align on frontHi,
Version 2.8.9 that was just released should address this issue. I’m marking the ticket as solved, but if it still doesn’t work for you, please follow up on the ticket.
Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] Query Map marker info ballon filter?Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] Query Map marker info ballon filter?Hi @ravanh You can copy this code: https://github.com/gsarig/ootb-openstreetmap/pull/57/files
This covers both use cases, where
$post_idis the post where the marker was defined, and$current_post_idis the id of the post where the map is displayed.Then, the filter should look like that:
add_filter('ootb_block_marker_text', 'customize_marker_text', 10, 3);
function customize_marker_text($text, $post_id, $current_post_id) {
// Your custom logic
return $text;
}This will be included in the next version, and I will let you know when it gets published. In the meantime, you can add it manually.
Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] Query Map marker info ballon filter?In that case, you would need to adjust the code to this:
foreach ( $attrs->markers as $marker ) {
if ( isset( $marker->text ) ) {
$marker->text = wp_kses_post( apply_filters( 'ootb_block_marker_text', $marker->text, $current_post_id) );
}
}(notice the
$current_post_idparameter that has been added)Then, you can use the filter like that:
add_filter('ootb_block_marker_text', 'customize_marker_text', 10, 2);
function customize_marker_text($text, $post_id) {
return $text . ' whatever additional info you want, plus the post id:' . $current_post_id;
}- This reply was modified 11 months, 2 weeks ago by Giorgos Sarigiannidis.
Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] Query Map marker info ballon filter?Hi!
The
ottb_cf_modal_contentcan only be used with the custom field feature (read more). I assume that you want to modify the text from the standard blocks. This is currently not supported, but it is a reasonable request.I will include it in the next update, but if you want to have it sooner, you can try adding this change to the plugin. More specifically
- Go to
includes/classes/Query.php - Find
$markers[] = $attrs->markers;and right before it, add the following:
foreach ( $attrs->markers as $marker ) {
if ( isset( $marker->text ) ) {
$marker->text = wp_kses_post( apply_filters( 'ootb_block_marker_text', $marker->text ) );
}
}Then, on your theme, you can use the filter like:
add_filter('ootb_block_marker_text', 'customize_marker_text', 10, 1);
function customize_marker_text($text) {
return $text . ' whatever additional info you want';
}I hope that it helps. If you try it out, let me know how it goes.
I will let you know when the next release will be out.
Thanks!
Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] WordPress 6.8Simply changing the extension wouldn’t work, because the plugin expects a very specific structure. Example:
[
{
"lat": "37.9839412",
"lng": "23.7283052",
"text": "<p>Athens, Municipality of Athens, Regional Unit of Central Athens, Attica, 104 31, Greece</p>",
"id": 1673647730152
},
{
"lat": "40.7127281",
"lng": "-74.0060152",
"text": "<p>New York, United States</p>",
"id": 1673647735921
},
{
"lat": "41.3828939",
"lng": "2.1774322",
"text": "<p>Barcelona, Barcelonès, Barcelona, Catalonia, 08001, Spain</p>",
"id": 1673647741383
},
{
"lat": "51.5073219",
"lng": "-0.1276474",
"text": "<p>London, Greater London, England, United Kingdom</p>",
"id": 1673647744636
}
]So, you ‘d have to go for example to ChatGPT, give it the contents of the
.geojsonand ask it to convert it to the specific format. Then, save the contents as a.jsonfile and try to import. In theory, this should work.Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] WordPress 6.8It isn’t possible and I hadn’t thought about it. I am thinking that there could be an indirect workaround, though. Currently, the plugin supports importing locations via a
.jsonfile (see here). The expected format is different, though, so if you have the data in.geojsonyou could try to use an AI tool to convert it to the expected format.This is an interesting feature, though, and I will consider adding it in a future update. The infrastructure to import/export data is there already, so I would only have to add support for the
.geojsonformat.Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] WordPress 6.8Great! Than’s again for flagging the issue!
Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] WordPress 6.8Hi again. This should be fixed with the latest update (2.8.7).
Can you please check to confirm?
Thanks!
Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] WordPress 6.8Hi,
Thanks for reporting this. I’ve identified the issue and working on a fix, which should be available later today. I will let you know when it’s ready.
Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] OpenAiFor the OpenAI test it’s strange, because I’ve been using it with the same configuration myself,
https://api.openai.com/v1/chat/completionsandgpt-3.5-turbo.For Gemini, though, it doesn’t seem to be the correct endpoint – can you try the URL
https://generativelanguage.googleapis.com/v1beta/chat/completions? Also, on my tests, I’ve used it withgemini-1.5-flash, which worked as expected.On both, I’ve used their free versions, and tested both locally and on a demo server.
Forum: Plugins
In reply to: [Out of the Block: OpenStreetMap] Map not showing on live pageHi,
Can you temporarily disable Complianz to see if that’s what’s blocking it? If that’s the case, another user reported something similar in the past (see the link), and posted the way that he solved it.
- Style URL format