Skip to content

Commit

Permalink
Round zoom level value in block controls (#29334)
Browse files Browse the repository at this point in the history
* Cherry-pick hook

* Cherry-pick

* WIP

* Markers & info window

* WIP useEffect dependency cleanup

* - MapRef for resizing
- Better zooming for multiple markers

* Some cleanup

* - Disable zoom control on map when we have more than 1 point

* Sane defaults when adding a map

* Remove TODO

* Add changelog

* Merge with location search

* Make check for mapRef more compact

* Rename createCalloutElement to createCalloutElementCallback

* Update style code styling

* Remove todo and add linebreak between import & function call

* Code style fix

* InfoWindow renaming

* Remove commented out console.log

* Mapkit doesn't have id's for places returned, so create one

* Fix resizing doing bad things

* Round zoom value
  • Loading branch information
TimBroddin authored Mar 9, 2023
1 parent 69f955a commit 096a0cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion projects/plugins/jetpack/extensions/blocks/map/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default ( {
)
}
disabled={ attributes.points.length > 1 }
value={ attributes.zoom }
value={ Math.round( attributes.zoom ) }
onChange={ value => {
setAttributes( { zoom: value } );
if ( mapRef.current && mapRef.current.updateZoom ) {
Expand Down

0 comments on commit 096a0cb

Please sign in to comment.