From f6143f5543d29ee4938a7c4e8d01bd28e88432c1 Mon Sep 17 00:00:00 2001 From: Gary Date: Fri, 14 Feb 2020 14:10:30 +1100 Subject: [PATCH] Save the scrollToZoom attribute on the
if it's enabled. --- extensions/blocks/map/save.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/extensions/blocks/map/save.js b/extensions/blocks/map/save.js index ffa82641dcd83..f777ef92967d8 100644 --- a/extensions/blocks/map/save.js +++ b/extensions/blocks/map/save.js @@ -7,7 +7,16 @@ import { Component } from '@wordpress/element'; class MapSave extends Component { render() { const { attributes } = this.props; - const { align, mapStyle, mapDetails, points, zoom, mapCenter, markerColor } = attributes; + const { + align, + mapStyle, + mapDetails, + points, + zoom, + mapCenter, + markerColor, + scrollToZoom, + } = attributes; const pointsList = points.map( ( point, index ) => { const { longitude, latitude } = point.coordinates; const url = 'https://www.google.com/maps/search/?api=1&query=' + latitude + ',' + longitude; @@ -28,6 +37,7 @@ class MapSave extends Component { data-zoom={ zoom } data-map-center={ JSON.stringify( mapCenter ) } data-marker-color={ markerColor } + data-scroll-to-zoom={ scrollToZoom ? scrollToZoom : null } > { points.length > 0 && }