mirror of https://gitee.com/antv-l7/antv-l7
feat: 调整官网水位图 demo
This commit is contained in:
parent
67fc3c1e82
commit
5c1fbee30e
|
@ -6,7 +6,7 @@ function draw(option) {
|
||||||
const [ width, height ] = size;
|
const [ width, height ] = size;
|
||||||
|
|
||||||
const radius = 30,
|
const radius = 30,
|
||||||
rectWidth = radius * 2 * window.devicePixelRatio;
|
rectWidth = radius * 2;
|
||||||
const rectHeight = rectWidth;
|
const rectHeight = rectWidth;
|
||||||
|
|
||||||
ctx.clearRect(0, 0, width, height);
|
ctx.clearRect(0, 0, width, height);
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default class Demo extends React.Component {
|
||||||
const [width, height] = size;
|
const [width, height] = size;
|
||||||
|
|
||||||
let radius = 30,
|
let radius = 30,
|
||||||
rectWidth = radius * 2 * window.devicePixelRatio;
|
rectWidth = radius * 2;
|
||||||
const rectHeight = rectWidth;
|
const rectHeight = rectWidth;
|
||||||
|
|
||||||
ctx.clearRect(0, 0, width, height);
|
ctx.clearRect(0, 0, width, height);
|
||||||
|
@ -80,6 +80,8 @@ export default class Demo extends React.Component {
|
||||||
|
|
||||||
points.map((point) => {
|
points.map((point) => {
|
||||||
let pixelCenter = mapService.lngLatToContainer([point.lng, point.lat]);
|
let pixelCenter = mapService.lngLatToContainer([point.lng, point.lat]);
|
||||||
|
pixelCenter.x *= window.devicePixelRatio;
|
||||||
|
pixelCenter.y *= window.devicePixelRatio;
|
||||||
let rectStartX = pixelCenter.x - radius;
|
let rectStartX = pixelCenter.x - radius;
|
||||||
const rectStartY = pixelCenter.y - radius;
|
const rectStartY = pixelCenter.y - radius;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue