diff --git a/docs/colors-and-icons.md b/docs/colors-and-icons.md index 4dc9f9e6..11962cf3 100644 --- a/docs/colors-and-icons.md +++ b/docs/colors-and-icons.md @@ -3,7 +3,7 @@ One of the first customisations is to change the marketplace colors and icons. -# Colors +## Colors To change the marketplace colors, open the [src/marketplace.css](../src/marketplace.css) file and change the @@ -15,7 +15,7 @@ color variables: --marketplaceColorDark: #8c291e; ``` -# Icons +## Icons The default icons are generated with [RealFaviconGenerator](https://realfavicongenerator.net/). You can @@ -60,3 +60,10 @@ point to those images. ``` + +## Map marker icon + +The map marker icon in the listing can be found in +[src/components/Map/images/marker.png](../src/components/Map/images/marker.png). The +dimensions should be 32x32 pixels, so the `favicon-32x32.png` file can +be used to replace the map icon. diff --git a/src/components/Map/Map.js b/src/components/Map/Map.js index 2645a25a..209b7f9c 100644 --- a/src/components/Map/Map.js +++ b/src/components/Map/Map.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import * as propTypes from '../../util/propTypes'; -import CustomMarker from './images/customMarker.png'; +import CustomMarker from './images/marker.png'; import css from './Map.css'; class Map extends Component { @@ -29,28 +29,18 @@ class Map extends Component { const customMarker = { url: CustomMarker, - // This marker is 21 pixels wide by 25 pixels high. - size: new window.google.maps.Size(21, 25), + // This marker is 32 pixels wide by 32 pixels high. + size: new window.google.maps.Size(32, 32), // The origin for this image is (0, 0). origin: new window.google.maps.Point(0, 0), - // The anchor for this image is the base of the flagpole at (10, 25). - anchor: new window.google.maps.Point(10, 25), + // The anchor for the marker is in the bottom center. + anchor: new window.google.maps.Point(16, 32), }; - // Shapes define the clickable region of the icon. The type defines an HTML - // element 'poly' which traces out a polygon as a series of X,Y points. - // The final coordinate closes the poly by connecting to the first coordinate. - const shape = { - coords: [1, 1, 1, 21, 25, 21, 25, 1], - type: 'poly', - }; - - // eslint-disable-next-line no-new new window.google.maps.Marker({ position: centerLocation, map, icon: customMarker, - shape, title: address, }); } diff --git a/src/components/Map/images/customMarker.png b/src/components/Map/images/customMarker.png deleted file mode 100644 index 9d12f848..00000000 Binary files a/src/components/Map/images/customMarker.png and /dev/null differ diff --git a/src/components/Map/images/marker.png b/src/components/Map/images/marker.png new file mode 100644 index 00000000..f2f8dc2b Binary files /dev/null and b/src/components/Map/images/marker.png differ