这个问题指的是标记出现-我正在使用React
https://i.stack.imgur.com/hkqnZ.jpg
我的标记出现在正确的位置我毫不怀疑,但在0,0上有一些初始标记没有消失,我不知道如何删除它。只有当我从VectorMap组件中移除' markers‘属性时,它才会消失,但正如你所知道的,在那之后不会出现任何标记。
此外,我已经尝试了“透明”填充标记等,但它也会影响更正标记。
有没有什么设置可以删除这个one?我做错了什么吗?还是仅仅是库错误?
<VectorMap
map={"world_mill"}
markers={{
latLng: [this.state.CountryFetchLat, this.state.CountryFetchLon],
name: this.state.CountryRegion
}}
backgroundColor="transparent"
zoomOnScroll={true}
zoomButtons={false}
containerStyle={{
width: "100%",
height: "90%"
}}
containerClassName="map"
markerStyle={{
initial: {
fill: "#4DAC26"
}
}}
regionStyle={{
initial: {
fill: "#cccccc",
"fill-opacity": 1,
stroke: "none",
"stroke-width": 0,
"stroke-opacity": 0
},
hover: {
"fill-opacity": 1,
fill: "#99ff99",
cursor: "pointer"
},
selected: {
fill: "#ff0000"
}
}}
selectedRegions={
this.state.CountryRegion
? this.state.CountryRegion.toUpperCase()
: null
}
/>发布于 2019-11-16 01:05:53
尝试以此格式排列标记:
markers={{
US: { latLng: [38.9, -98.45], name: 'Name of City' }
}}这将使“幻影”标记消失。
希望这能有所帮助。
https://stackoverflow.com/questions/57844307
复制相似问题