Skip to content

Commit

Permalink
Merge pull request #455 from InfoAmazonia/develop
Browse files Browse the repository at this point in the history
Release 2.12.2
  • Loading branch information
leopiccionia authored Nov 21, 2024
2 parents 998ca73 + 5e6e5d1 commit f5f65cb
Show file tree
Hide file tree
Showing 7 changed files with 4,656 additions and 22,475 deletions.
27,082 changes: 4,623 additions & 22,459 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/README.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
=== JEO ===
Contributors: earthjournalism
Tested up to: 6.6.2
Stable tag: 2.12.1
Stable tag: 2.12.2
Requires PHP: 7.2
Requires at least: 6.2
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
Version: 2.12.1
Version: 2.12.2

The JEO plugin acts as a geojournalism platform that allows news organizations, bloggers and NGOs to publish news stories as layers of information on digital maps.

Expand Down Expand Up @@ -49,6 +49,9 @@ After activating the plugin, a new item will appear on the WordPress dashboard:

== Changelog ==

= 2.12.2 =
*bugfix: Fix regression on updating `mapbox-tileset-vector` layers

= 2.12.1 =
*bugfix: Fix bugs on saving legends changes

Expand Down
2 changes: 0 additions & 2 deletions src/includes/layer-types/mapbox-tileset-raster.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ window.JeoLayerTypes.registerLayerType( 'mapbox-tileset-raster', {
id: attributes.layer_id,
type: attributes.layer_type_options.type,
source: attributes.layer_id,
'source-layer': '',
},
],
} );
Expand All @@ -44,7 +43,6 @@ window.JeoLayerTypes.registerLayerType( 'mapbox-tileset-raster', {
id: attributes.layer_id,
type: attributes.layer_type_options.type,
source: attributes.layer_id,
'source-layer': '',
};

if ( ! attributes.visible ) {
Expand Down
4 changes: 2 additions & 2 deletions src/jeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @wordpress-plugin
* Plugin Name: JEO WP
* Description: Interactive Map blocks for Wordpress Gutenberg
* Version: 2.12.1
* Version: 2.12.2
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: jeo
Expand All @@ -22,7 +22,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'JEO_VERSION', '2.12.1' );
define( 'JEO_VERSION', '2.12.2' );

define( 'JEO_BASEPATH', plugin_dir_path( __FILE__ ) );
define( 'JEO_BASEURL', plugins_url('', __FILE__) );
Expand Down
3 changes: 1 addition & 2 deletions src/js/src/discovery/blocks/map-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class MapLayers extends Component {
id: layerId,
type: attributes.layer_type_options.type,
source: layerId,
'source-layer': attributes.source_layer,
'source-layer': attributes.layer_type_options.source_layer,
};

map.addLayer( newLayer );
Expand Down Expand Up @@ -341,7 +341,6 @@ class MapLayers extends Component {
id: layerId,
type: attributes.layer_type_options.type,
source: layerId,
'source-layer': '',
};

map.addLayer( newLayer );
Expand Down
26 changes: 20 additions & 6 deletions src/js/src/map-blocks/map-preview-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function renderLayer( { layer, instance } ) {
const sourceId = `source_${ instance.id }`;

switch ( layer.type ) {
case 'mapbox':
case 'mapbox': {
const accessToken = options.access_token || window.mapboxgl.accessToken;

const styleId = options.style_id?.replace( 'mapbox://styles/', '' );
Expand All @@ -23,9 +23,9 @@ export function renderLayer( { layer, instance } ) {
<Layer id={ layerId } type="raster" />
</Source>
);
}

case 'mapbox-tileset-vector':
case 'mapbox-tileset-raster':
case 'mapbox-tileset-raster': {
const tilesetId = options.tileset_id;
const tilesetUrl = tilesetId.includes( 'mapbox://' ) ? tilesetId : `mapbox://${ tilesetId }`;

Expand All @@ -34,20 +34,34 @@ export function renderLayer( { layer, instance } ) {
<Layer id={ layerId } type={ options.type } />
</Source>
);
}

case 'mapbox-tileset-vector': {
const tilesetId = options.tileset_id;
const tilesetUrl = tilesetId.includes( 'mapbox://' ) ? tilesetId : `mapbox://${ tilesetId }`;

case 'mvt':
return (
<Source key={ tilesetUrl } id={ sourceId } type={ options.style_source_type } url={ tilesetUrl }>
<Layer id={ layerId } type={ options.type } source-layer={ options.source_layer } />
</Source>
);
}

case 'mvt': {
return (
<Source key={ options.url } id={ sourceId } type={ options.style_source_type } tiles={ [ options.url ] }>
<Layer id={ layerId } type={ options.type } />
<Layer id={ layerId } type={ options.type } source-layer={ options.source_layer } />
</Source>
);
}

case 'tilelayer':
case 'tilelayer': {
return (
<Source id={ sourceId } type="raster" tiles={ [ options.url ] } tileSize={ 256 } scheme={ options.scheme || 'xyz' }>
<Layer id={ layerId } type="raster" />
</Source>
);
}

default:
return null;
Expand Down
7 changes: 5 additions & 2 deletions trunk/readme.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
=== JEO ===
Contributors: earthjournalism
Tested up to: 6.6.2
Stable tag: 2.12.1
Stable tag: 2.12.2
Requires PHP: 7.2
Requires at least: 6.2
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
Version: 2.12.1
Version: 2.12.2

The JEO plugin acts as a geojournalism platform that allows news organizations, bloggers and NGOs to publish news stories as layers of information on digital maps.

Expand Down Expand Up @@ -49,6 +49,9 @@ After activating the plugin, a new item will appear on the WordPress dashboard:

== Changelog ==

= 2.12.2 =
*bugfix: Fix regression on updating `mapbox-tileset-vector` layers

= 2.12.1 =
*bugfix: Fix bugs on saving legends changes

Expand Down

0 comments on commit f5f65cb

Please sign in to comment.