-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Markers with ZoomableGlobe #72
Comments
Hi @maalej , ...
<Marker
key={...}
marker={...}
style={{
hidden: { display: "none" },
}}>
<circle cx={0} cy={0} r={10} />
</Marker>
... Let me know if this solves your problem. |
@zimrick Thank you very much for your response. Your solution does resolve my problem. Thank you. |
Is this the behaviour you are looking for? If you want that you will have to render out the circles using import { geoCircle } from "d3-geo"
const circles = [
geoCircle().center([3.4,6.5]).radius(10)(),
geoCircle().center([100.5,13.7]).radius(5)(),
geoCircle().center([-99.1,19.4]).radius(3)(),
]
// ...
render() {
return (
<ComposableMap projection="orthographic">
<ZoomableGlobe sensitivity={0.5}>
<Graticule globe style={{ strokeWidth: 0.5, strokeDasharray: [0,0] }} />
<Geographies geography="/static/world-110m.json" disableOptimization>
{(geos, proj) =>
geos.map((geo, i) =>
<Geography
key={geo.properties.ISO_A3 + i}
geography={geo}
projection={proj}
style={{
default: { fill: "#DDD" },
hover: { fill: "#DDD" },
pressed: { fill: "#DDD" },
}}
/>
)}
</Geographies>
<Geographies geography={circles} disableOptimization>
{(geos, proj) =>
geos.map((geo, i) =>
<Geography
key={i}
geography={geo}
projection={proj}
style={{
default: { fill: "#FF5722", stroke: "#FFF" },
hover: { fill: "#FF5722", stroke: "#FFF" },
}}
/>
)}
</Geographies>
</ZoomableGlobe>
</ComposableMap>
)
} Hope this helps. |
@zimrick Where did you get the json for that world map? Exactly what I am looking for, the one in the example has a lot of polygon data I'd like to dump for speed. EDIT: Got it, just deleted all of the countries. A custom map maker would be awesome for his but would need to know what correlates first. |
Note (in case it's relevant) you can use this tool: https://mapshaper.org/ You can simplify any map quite easily there and then export it back as topojson for use with react-simple-maps. I describe the process in more detail here: |
Hi, is this functionality possible in the new version with ZoomableGroup? |
Not at the moment. The goal is to implement a proper globe with pinch zoom, but that will require a bit more time. |
Hello 👋 Is zoomable globe component still available? I can't find it while searching the repository. I also can't find the commit that removed it, hence I am asking about it. Thank you 🙏 |
I reverted to version "react-simple-maps": "0.11.1" and it is available there |
Hey 🙌 There's any solution to hide the markers on version |
Hello & Thank you for this library.
When I display markers on ZoomableGlobe, they don't disappear while rotating the globe.
The text was updated successfully, but these errors were encountered: