|
@@ -29,6 +29,8 @@ export const DageMap = forwardRef<DageMapMethods, DageMapProps>(
|
|
|
onlyCityArea,
|
|
|
inputTipsApi,
|
|
|
outCityAreaMessage,
|
|
|
+ markerProps,
|
|
|
+ children,
|
|
|
onAddressChange,
|
|
|
onLngLatChange,
|
|
|
onMapComplete,
|
|
@@ -66,6 +68,8 @@ export const DageMap = forwardRef<DageMapMethods, DageMapProps>(
|
|
|
|
|
|
const handleSearch = useCallback(
|
|
|
debounce(async (value: string) => {
|
|
|
+ if (!inputTipsApi) return;
|
|
|
+
|
|
|
if (!value) {
|
|
|
setOptions([]);
|
|
|
return;
|
|
@@ -201,23 +205,25 @@ export const DageMap = forwardRef<DageMapMethods, DageMapProps>(
|
|
|
|
|
|
return (
|
|
|
<>
|
|
|
- <div>
|
|
|
- <AutoComplete
|
|
|
- allowClear
|
|
|
- disabled={disabled}
|
|
|
- value={address}
|
|
|
- style={{ width: 450 }}
|
|
|
- options={options.map((i) => ({
|
|
|
- ...i,
|
|
|
- value: i.name,
|
|
|
- }))}
|
|
|
- onSearch={handleSearch}
|
|
|
- onSelect={handleSelect}
|
|
|
- onChange={handleAutoCompleteChange}
|
|
|
- >
|
|
|
- <Input allowClear placeholder="请输入详细描述" />
|
|
|
- </AutoComplete>
|
|
|
- </div>
|
|
|
+ {Boolean(inputTipsApi) && (
|
|
|
+ <div>
|
|
|
+ <AutoComplete
|
|
|
+ allowClear
|
|
|
+ disabled={disabled}
|
|
|
+ value={address}
|
|
|
+ style={{ width: 450 }}
|
|
|
+ options={options.map((i) => ({
|
|
|
+ ...i,
|
|
|
+ value: i.name,
|
|
|
+ }))}
|
|
|
+ onSearch={handleSearch}
|
|
|
+ onSelect={handleSelect}
|
|
|
+ onChange={handleAutoCompleteChange}
|
|
|
+ >
|
|
|
+ <Input allowClear placeholder="请输入详细描述" />
|
|
|
+ </AutoComplete>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
|
|
|
<Space style={{ margin: "15px 0" }}>
|
|
|
<Input
|
|
@@ -251,6 +257,7 @@ export const DageMap = forwardRef<DageMapMethods, DageMapProps>(
|
|
|
{loaded && position ? (
|
|
|
<>
|
|
|
<Marker
|
|
|
+ {...markerProps}
|
|
|
position={position}
|
|
|
draggable={!disabled}
|
|
|
onDragging={handleMarker}
|
|
@@ -264,6 +271,8 @@ export const DageMap = forwardRef<DageMapMethods, DageMapProps>(
|
|
|
onError={handleOutCityAreaError}
|
|
|
/>
|
|
|
)}
|
|
|
+
|
|
|
+ {children}
|
|
|
</>
|
|
|
) : (
|
|
|
<></>
|