-
Notifications
You must be signed in to change notification settings - Fork 643
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 新增 Popup 支持更新 className 和 style (#2457)
- Loading branch information
Showing
4 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@antv/l7-component': patch | ||
--- | ||
|
||
popup 更新支持 className 和 style |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export { MapRender as control } from './control'; | ||
export { MapRender as layerPopup } from './layerPopup'; | ||
export { MapRender as marker } from './marker'; | ||
export { MapRender as popup } from './popup'; | ||
export { MapRender as swipe } from './swipe'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Popup, Scene } from '@antv/l7'; | ||
import * as allMap from '@antv/l7-maps'; | ||
import type { RenderDemoOptions } from '../../types'; | ||
|
||
export function MapRender(options: RenderDemoOptions) { | ||
const scene = new Scene({ | ||
id: 'map', | ||
renderer: options.renderer, | ||
map: new allMap.GaodeMap({ | ||
style: 'light', | ||
center: [121.435159, 31.256971], | ||
zoom: 14.89, | ||
minZoom: 10, | ||
}), | ||
}); | ||
scene.on('loaded', () => { | ||
const popup = new Popup({ | ||
lngLat: { | ||
lng: 121.435159, | ||
lat: 31.256971, | ||
}, | ||
html: '<div>123456</div>', | ||
className: String(Math.random()), | ||
style: `z-index: ${String(Math.random())}`, | ||
}); | ||
|
||
setInterval(() => { | ||
popup.setOptions({ | ||
className: String(Math.random()), | ||
style: `z-index: ${String(Math.floor(Math.random() * 100))}`, | ||
}); | ||
}, 2000); | ||
|
||
scene.addPopup(popup); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters