custom default image marker for csv item #6847
-
Would it be possible to use image to replace the default marker style for a csv item? In the init file, if i set the marker to any of the Maki icons the default marker will change accordingly. However, if i tried to use an image (ex: test/images/place32.png), it will only show point not the image. Any idea? "point": { |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
For using custom images as icons the {
"type": "csv",
"name": "CSV Test",
"url": "test/incidents_notime.csv",
"defaultStyle": {
"point": {
"null": {
"marker": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAZNJREFUWIXtlrFLQlEUxr/QPGYhTbYEhhgWErjU0twQ9AdEGNnU0CiBL60pMBqC2gSHhgoamhoFt8ZaIugtQhFFY1Hmp0EN+ehZDd3e84ngB493733vnPPjXj7OdaPFcncA2h3AIyLrJBMiskcy01QAEdkgmTavkTTeaQDpbyFdtgKQXFH5/y9SPQKPefII7PuB2Xqe0xGRgE4ONxOgQX4gbppOHpGlmGIOW10wCoRUY2wFKP0jxhJAHMAqgCCAawBRpwEO6o8VWQKYjqK8lYAEA3Bd3UGf0BBxFOBYg6+n+3M8HkJkaQqVXAFexwCM4oZ2F+HNFdRytHczeq017sJyHi8Aeh0DmMniaSeB96EBeC5ucJ4vYlI1hyWA4iX8Y1/tSbm4ZQCJohxegHgDcD3fQtczDtswtgafMe4PIxLZRElPqfUDW13QN9jiZlR5UI+xBPBWA9wmG96fNN+GVZhuRWfzP74rFVcGEJFtkinVIrYBkNQAaKYlj4hkSc6JyCHJZFMBflG1XjRpXM+dBrCsDsAHoPtrwlSQt8wAAAAASUVORK5CYII=",
"height": 20,
"width": 20
}
}
}
} You can generate a Let me know if that works for you. |
Beta Was this translation helpful? Give feedback.
Hi @noobHappylife
For using custom images as icons the
marker
property must be set to a data-uri likedata:image/png..
. Here is a full working example which you can see in action here.