diff --git a/docs/zh-CN/components/form/location-picker.md b/docs/zh-CN/components/form/location-picker.md index 5952fd542fe..d7476a7fe12 100644 --- a/docs/zh-CN/components/form/location-picker.md +++ b/docs/zh-CN/components/form/location-picker.md @@ -112,6 +112,7 @@ order: 30 | staticSchema.embed | `boolean` | false | 是否内嵌地图展示地理位置 | | staticSchema.showAddress | `boolean` | true | 内嵌模式是否展示文字地址 | | staticSchema.showGeoLoc | `boolean` | false | 内嵌模式是否展示定位当当前控件 | +| staticSchema.mapStyle | `object` | | 内嵌模式地图的样式,可以传宽高控制大小 | ### 坐标系说明 diff --git a/packages/amis-ui/src/components/BaiduMapPicker.tsx b/packages/amis-ui/src/components/BaiduMapPicker.tsx index 8466eee3057..5183adbbeef 100644 --- a/packages/amis-ui/src/components/BaiduMapPicker.tsx +++ b/packages/amis-ui/src/components/BaiduMapPicker.tsx @@ -43,6 +43,7 @@ interface MapPickerProps { onlySelectCurrentLoc?: boolean; showSug?: boolean; showGeoLoc?: boolean; + mapStyle?: React.CSSProperties; } interface LocationItem { @@ -346,7 +347,7 @@ export class BaiduMapPicker extends React.Component< } render() { - const {classnames: cx} = this.props; + const {classnames: cx, mapStyle} = this.props; const onlySelectCurrentLoc = this.props.onlySelectCurrentLoc ?? false; const {locIndex, locs, inputValue, sugs} = this.state; const showSug = this.props.showSug ?? true; @@ -371,6 +372,7 @@ export class BaiduMapPicker extends React.Component< className={cx('MapPicker-map', { invisible: hasSug })} + style={mapStyle} /> {!showSug ? null : ( diff --git a/packages/amis/src/renderers/Form/LocationPicker.tsx b/packages/amis/src/renderers/Form/LocationPicker.tsx index 85339992bca..2a3f2a5b9b8 100644 --- a/packages/amis/src/renderers/Form/LocationPicker.tsx +++ b/packages/amis/src/renderers/Form/LocationPicker.tsx @@ -172,6 +172,7 @@ export class LocationControl extends React.Component { onlySelectCurrentLoc={true} showSug={false} showGeoLoc={staticSchema.showGeoLoc} + mapStyle={staticSchema.mapStyle} /> ) : ( diff --git a/packages/amis/src/renderers/Image.tsx b/packages/amis/src/renderers/Image.tsx index f5470485926..a327cea4a34 100644 --- a/packages/amis/src/renderers/Image.tsx +++ b/packages/amis/src/renderers/Image.tsx @@ -623,7 +623,7 @@ export class ImageField extends React.Component< themeCss: wrapperCustomStyle }) )} - style={{...style, transform: `scale(${this.state.scale})`}} + style={{transform: `scale(${this.state.scale})`, ...style}} onClick={this.handleClick} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave}