Skip to content

Commit

Permalink
Merge branch 'release/2.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gsarig committed May 26, 2024
2 parents 72ab245 + 9e33df8 commit c43bb3b
Show file tree
Hide file tree
Showing 84 changed files with 2,763 additions and 2,386 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Instead of manually adding coordinates for each one of your markers, just click-
* OpenAI integration which allows you to add markers by using commands in natural language. Just say "please" to activate (e.g. "Please, show me where GOT was filmed"). Requires an OpenAI API key. [Read more](https://www.gsarigiannidis.gr/openstreetmap-openai-integration/).
* Query Maps: Supports creating a map out of maps added on other posts or post types. This can be quite powerful when, for example, you have a custom post type for "Places" with each place having its own map, and you want to dynamically gather-up all the places on a single map.
* Shortcode support: You can use the shortcode `[ootb_query]` as an alternative way to use the aforementioned Query Maps feature (see the FAQ for more info).
* Support for a location custom field, which can be used to store a post's or post type's location, following the [Geodata guidelines](https://codex.wordpress.org/Geodata). Read more in the [v.2.8.0 release notes](https://github.com/gsarig/ootb-openstreetmap/releases/tag/2.8.0).
* Adjust the map height.
* Change the default marker icon with a custom one.
* Enable or disable map dragging.
Expand Down Expand Up @@ -92,6 +93,7 @@ On the block's side panel, Select the "Map data" panel and click on the "Fetch l

### How can I use the shortcode?
The shortcode `[ootb_query]` allows you to display a dynamic map, which retrieves markers from other posts or post types. Just add it to a post or page and you're good to go. By default, it will fetch the markers from the 100 most recent posts. The shortcode supports the following attributes:
* source: (Optional) The source of the data. Can be either `geodata`, if you want to retrieve the posts based on their Location custom meta field, or `block`, to retrieve posts containing map blocks in their content. The default option, which will be used if the attribute is omitted, is `block`.
* post_type: (Optional) The type of post to query. By default, it is set to `post`.
* posts_per_page: (Optional) The number of posts to be displayed on page. Default value is `100`.
* post_ids: (Optional) Comma-separated IDs of the posts to include in the query.
Expand Down
2 changes: 1 addition & 1 deletion assets/css/admin/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
}

.ootb_info {
grid-row-end: 11;
grid-row-end: 14;
grid-row-start: 1;
grid-column-start: 2;
}
Expand Down
17 changes: 17 additions & 0 deletions assets/js/admin/settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(function () {
'use strict';
document.addEventListener('DOMContentLoaded', (event) => {
function toggleGeoPostTypes() {
const checkbox = document.querySelector('#geodata');
const geoPostTypesRow = document.querySelector('.ootb--geo_post_types');

geoPostTypesRow.style.display = checkbox.checked ? 'table-row' : 'none';
}

// On page load
toggleGeoPostTypes();

// When the checkbox changes
document.querySelector('#geodata').addEventListener('change', toggleGeoPostTypes);
});
})();
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// noinspection NpmUsedModulesInstalled,JSUnresolvedVariable
import createMapboxStyleUrl from "./shared/createMapboxStyleUrl.js";
import createMapboxStyleUrl from "../shared/createMapboxStyleUrl.js";

(function () {
'use strict';
Expand Down
File renamed without changes.
140 changes: 0 additions & 140 deletions build/block.json

This file was deleted.

2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'a1c8a4f98cbb3438e3fc');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '231a97783f847daa82f0');
Loading

0 comments on commit c43bb3b

Please sign in to comment.