Skip to content

🤔 [QUESTION] 绘制enable时,如果点击点不是Map,而是map上的其他元素如 Marker,如何阻止呢? #188

@America-first-melon

Description

@America-first-melon

🐛 Question description [Please make everyone to understand it]

绘制已经enable时,如果点击点不是Map,而是map上的其他元素如 Marker,如何阻止呢?

import type { LarkMapProps } from '@antv/larkmap';
import { LarkMap, Marker } from '@antv/larkmap';
import { message } from 'antd';
import React from 'react';

const larkmapOptions: LarkMapProps = {
  mapType: 'Gaode',
  mapOptions: { center: [120.210792, 30.246026], zoom: 10 },
};

export default () => (
  <LarkMap {...larkmapOptions} style={{ height: '300px' }}>
    <Marker
      lngLat={{ lng: 120.210792, lat: 30.246026 }}
      anchor="center"
      onClick={(event) => {
           // event.target.stopPropagation() 无作用
          message.success('Marker clicked!')
      }}
    >
      <div style={{ padding: 8, backgroundColor: 'pink' }}>杭州</div>
    </Marker>
  </LarkMap>
);

💻 Link to minimal reproduction

Please provide a link by forking these links L7 Draw or GitHub repo. What is a minimal reproduction, and why is it required?

🏞 Expected result

🚑 Any additional [like screenshots]

  • L7Draw Version:
  • Platform:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions