Google Maps Rectangle editable: how to lock (fixed) height from editing
问题 I have a Google Map, in it a rectangle which is editable, moveable and resizable etc. What I am looking for is a way to lock the given height of the rectangle, so only the width can be changed. 回答1: You can prevent the rectangle from resizing the height with the bounds_changed Event in JavaScript. Here is a working jsfiddle: http://jsfiddle.net/h7ee4368/ Rectangle api reference: https://developers.google.com/maps/documentation/javascript/reference?hl=de#Rectangle JavaScript src: var rectangle