how to set markers in d3.js map projection
svg
.append("g")
.attr("class", "cluster-markers")
.selectAll("g")
.data(data)
.enter()
.append("g")
.attr("transform", function (d) {
return "translate(" + projection([d.lng, d.lat]) + ")";
})
.append("circle")
.attr("r", 1);
//----------------------------------------------
svg
.selectAll(".mark")
.data(data)
.enter()
.append("image")
.attr("class", "mark")
.attr("width", 20)
.attr("height", 20)
.attr(
"xlink:href",
"https://cdn2.iconfinder.com/data/icons/bitsies/128/Location-512.png"
)
.attr("transform", function (d) {
return "translate(" + projection([d.lng, d.lat]) + ")";
});
//-------------------------------------------------
svg
.selectAll(".path")
.data(data)
.enter()
.append("path")
.attr("class", "marker")
.attr("width", 20)
.attr("height", 20)
.attr("transform", function (d) {
return "translate(" + projection([d.lng, d.lat]) + ")";
})
.attr("d", ICON)
.attr("fill", "red")
.attr("opacity", 0.4)
Also in JavaScript:
- console.log('qqqqqqqqqqqqqqqqqqqq'); jslint error how to fix
- how to make use of nodejs single thread to read files and attach data
- dark mode with react hooks
- const{}=
- angular add object to array
- factorial program in javascript
- javascript on submit
- app.router.navigate reset framework7
- add parameter submit form javascript
- how to write and read a text file in jdiscord.js
- pass array to function javascript
- routerlink for button in angular 7
- csv export in react
- jquery ajax get
- js onscroll event
- get every other item in an array
- new date() in javascript 3 days from now
- capitalize in javascript
- Mobx-react console warning related observer
- react check if string is mail
- how to wirte json format
- how to store textbox data while typing for chrome extension
- how to write a program that displays a message “It’s Fun day” if it's Saturday or Sunday today in javascript
- electron file association