首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我和MarkerClusterer有点问题

我和MarkerClusterer有点问题
EN

Stack Overflow用户
提问于 2020-09-04 12:59:21
回答 1查看 29关注 0票数 0

谁能给我解释一下为什么MarkerClusterer只有一个标记时会显示两个标记!这是我的代码:

代码语言:javascript
复制
   const MapWithMarkerClusterer = compose(
   withProps({
    googleMapURL:
    "https://maps.googleapis.com/maps/api/jskey=API_KEY&v=3.exp& 
    libraries=geometry,drawing,places",
    loadingElement: <div style={{ height: `100%` }} />,
    containerElement: <div style={{ height: `400px` }} />,
    mapElement: <div style={{ height: `100%` }} />,
    center: { lat: 25.03, lng: 121.6 },
   }),
   withScriptjs,
   withGoogleMap
   )((props) => (
   <GoogleMap
    defaultZoom={10}
    defaultCenter={{ lat: 19.807151, lng: 105.795327 }}
   >
    <MarkerClusterer averageCenter enableRetinaIcons gridSize={100}>
      <Marker
        position={{
          lat: 19.807151,
          lng: 105.795327,
        }}
      />
    </MarkerClusterer>
    </GoogleMap>
   ));

   export default MapWithMarkerClusterer;

照片描述

EN

回答 1

Stack Overflow用户

发布于 2020-09-04 14:34:25

这样啊,原来是这么回事!因为strictMode!当我删除它的时候,一切都很好!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63735077

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档