Before opening an issue, make sure to read the contributing guide and understand this is a bug tracker, not a support platform.
Please make sure to check the following boxes before submitting an issue.
Issues opened without using this template will be closed unless they have a good reason not to follow this template.
Popup should work with CircleMarker
Popup not working with CircleMarker
In plain old JS (this works)
stationLocations.map((k, i) => {
L.circleMarker([k.LATITUDE, k.LONGITUDE])
.bindPopup(`<span>${k.STID}</span>`)
.addTo(stationsLayer)
});
Works with Marker (per docs)
return (
<Map center={this.state.mapCenter} zoom={this.state.zoomLevel}>
<TileLayer attribution={timeAttrib} url={tiles} />
{this.state.stations.map((k, i) => {
return (
<Marker key={i} position={[Number(k.LATITUDE), Number(k.LONGITUDE)]}>
<Popup><span>k.STID</span></Popup>
</Marker>
)
})}
</Map>
);
Does not work with CircleMarker
return (
<Map center={this.state.mapCenter} zoom={this.state.zoomLevel}>
<TileLayer attribution={timeAttrib} url={tiles} />
{this.state.stations.map((k, i) => {
return (
<CircleMarker key={i} center={[Number(k.LATITUDE), Number(k.LONGITUDE)]}>
<Popup><span>k.STID</span></Popup>
</CircleMarker>
)
})}
</Map>
);
Thanks for reporting this, it should be fixed in v1.7.6, please try it out.
@PaulLeCam still unable to get it to work. Updated to 1.7.6 today. Any insight?
You can check this example that works as expected. If it doesn't for you it's most likely an issue with your environment.
Even after modling my code after yours, no luck. I'm using create-react-app v1.4.3 right out of the box.
return (
<Map center={this.state.mapCenter} zoom={this.state.zoomLevel}>
<TileLayer attribution={attrib} url={tiles} />
<CircleMarker center={[40.65, -111.5]} color="darkblue" weight={4} radius={20}>
<Popup>
<span>Popup in CircleMarker</span>
</Popup>
</CircleMarker>
</Map>
)
Sorry but this is not helpful, please provide a WebpackBin or similar.
I don't know why your example doesn't work but this one does so I suggest you start from there to see what fails with your setup.
Figured it out. Changed the CDN on the CSS and it worked. Thanks for your help Paul.
Most helpful comment
Figured it out. Changed the CDN on the CSS and it worked. Thanks for your help Paul.