Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit 95f1c66

Browse files
authored
fix: geocoding marker is not showing
1 parent 702df02 commit 95f1c66

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Disable immutable & serializable checks for redux store on production [#190](https://github.com/CartoDB/carto-react-template/pull/190)
77
- Fix the cleaning of the isochrone if user logouts[#188](https://github.com/CartoDB/carto-react-template/pull/188)
88
- Fix hard interactivity on mobile adding pickingRadius to layers [#191](https://github.com/CartoDB/carto-react-template/pull/191)
9+
- Fix geocoding marker is not showing [#192](https://github.com/CartoDB/carto-react-template/pull/192)
910

1011
## 1.0.0-beta11 (2021-02-02)
1112
- Remove datasets section [#175](https://github.com/CartoDB/carto-react-template/pull/175)

template-sample-app/template/src/components/layers/GeocoderLayer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useSelector } from 'react-redux';
22
import { IconLayer } from '@deck.gl/layers';
33
import geocoderMarker from 'assets/markers/geocoder-marker.svg';
4+
import { svgToDataURL } from 'utils/svgToDataUrl';
45

56
export const GEOCODER_LAYER_ID = 'geocoderLayer';
67

@@ -14,7 +15,7 @@ function GeocoderLayer() {
1415
return new IconLayer({
1516
id: GEOCODER_LAYER_ID,
1617
getIcon: () => ({
17-
url: geocoderMarker,
18+
url: svgToDataURL(geocoderMarker),
1819
width: 56,
1920
height: 65,
2021
anchorY: 65,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function svgToDataURL(svg) {
2+
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
3+
}

0 commit comments

Comments
 (0)