feat: LocationPicker 支持全局设置 ak (#8732)

This commit is contained in:
liaoxuezhi 2023-11-14 17:31:00 +08:00 committed by GitHub
parent a5326fef03
commit 1ec20cbbeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 5 deletions

View File

@ -87,6 +87,16 @@ export interface RendererEnv {
affixOffsetBottom?: number;
richTextToken: string;
/**
* baidu
*/
locationPickerVendor?: string;
/**
* ak
*/
locationPickerAK?: string;
loadRenderer: (
schema: Schema,
path: string,

View File

@ -132,6 +132,13 @@
max-width: 100%;
margin-top: -1px;
border-color: var(--Form-input-onFocused-borderColor);
&.#{$ns}PopOver--v-top {
margin-top: px2rem(4px);
}
&.#{$ns}PopOver--v-bottom {
margin-bottom: px2rem(4px);
}
}
.#{$ns}MapPicker {

View File

@ -142,17 +142,15 @@ export class LocationControl extends React.Component<LocationControlProps> {
@supportStatic()
render() {
const {style} = this.props;
const {style, env} = this.props;
const ak = filter(this.props.ak, this.props.data) || env.locationPickerAK!;
return (
<div
className={this.props.classnames('LocationControl', {
'is-mobile': isMobile()
})}
>
<LocationPicker
{...this.props}
ak={filter(this.props.ak, this.props.data)}
/>
<LocationPicker {...this.props} ak={ak} />
</div>
);
}