Forum Replies Created

Viewing 15 replies - 1 through 15 (of 231 total)
  • Hi 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:

    1. 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.
    2. 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.
    3. 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!

    Hi @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.

    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.

    Hi,

    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.

    Plugin Author Giorgos Sarigiannidis

    (@gsarig)

    Hi

    This has been deployed with version 2.8.8.

    Thanks for reporting it!

    Hi @ravanh You can copy this code: https://github.com/gsarig/ootb-openstreetmap/pull/57/files

    This covers both use cases, where $post_id is the post where the marker was defined, and $current_post_id is 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.

    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_id parameter 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;
    }

    Hi!

    The ottb_cf_modal_content can 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

    1. Go to includes/classes/Query.php
    2. 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!

    Plugin Author Giorgos Sarigiannidis

    (@gsarig)

    Simply 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 .geojson and ask it to convert it to the specific format. Then, save the contents as a .json file and try to import. In theory, this should work.

    Plugin Author Giorgos Sarigiannidis

    (@gsarig)

    It 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 .json file (see here). The expected format is different, though, so if you have the data in .geojson you 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 .geojson format.

    Plugin Author Giorgos Sarigiannidis

    (@gsarig)

    Great! Than’s again for flagging the issue!

    Plugin Author Giorgos Sarigiannidis

    (@gsarig)

    Hi again. This should be fixed with the latest update (2.8.7).

    Can you please check to confirm?

    Thanks!

    Plugin Author Giorgos Sarigiannidis

    (@gsarig)

    Hi,

    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.

    For the OpenAI test it’s strange, because I’ve been using it with the same configuration myself, https://api.openai.com/v1/chat/completions and gpt-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 with gemini-1.5-flash, which worked as expected.

    On both, I’ve used their free versions, and tested both locally and on a demo server.

    Hi,

    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.

Viewing 15 replies - 1 through 15 (of 231 total)