Skip to content

Commit

Permalink
Save the scrollToZoom attribute on the <div> if it's enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
pento committed Feb 14, 2020
1 parent 172127f commit f6143f5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion extensions/blocks/map/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 && <ul>{ pointsList }</ul> }
</div>
Expand Down

0 comments on commit f6143f5

Please sign in to comment.