问题描述
我在 R 中使用了传单。我有一个非常好的功能来制作用户友好的地图报告。缩小圆圈时会合并,放大圆圈时会折叠它们的位置。我在 react-leaflet 及其文档中找不到它 提前致谢
import { Map,CircleMarker,TileLayer,Marker,Popup } from "react-leaflet";
<Map
ref={refMap}
center={position}
zoom={zoom}
style={{ height: "400px",width: "100%",zIndex: 0 }}
>
<TileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution='© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
/>
{uniqueLocs
? uniqueLocs.map((Id) => (
<CircleMarker
center={[
stocks.find((e) => e.OpId === Id)["Latitude"],stocks.find((e) => e.OpId === Id)["Longitude"],]}
color={
stocks
.filter((e) => e.OpId === Id && e.CustomerID != 1)
.reduce((currentTotal,item) => { return item.Quantity + currentTotal; },0) > 400 ? "#dd2c00" :
stocks.filter((e) => e.OpId === Id && e.CustomerID != 1).length > 0 ? "#00416d" :
stocks
.filter((e) => e.OpId === Id && e.CustomerID === 1)
.reduce((currentTotal,0) > 400 ? "red" : "green"
}
radius="20"
fillOpacity={0.6}
stroke={false}
>
<Popup>
<span style={{ fontSize: "11px" }}>
<br />
{stocks.find((e) => e.OpId === Id)["MainCustomer"]} || {stocks.find((e) => e.OpId === Id)["OpCenter"]}
|| Total:{" "}
{stocks
.filter((e) => e.OpId === Id)
.reduce((currentTotal,item) => {
return item.Quantity + currentTotal;
},0)}
</span>
</Popup>
</CircleMarker>
))
: "Loading..."}
</Map>````
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)