From 90377d11de19db7a48a4732008b2322ba3020b17 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Wed, 29 Nov 2017 14:27:30 +0200 Subject: [PATCH] Use the 32x32 favicon as the map marker for easy customisation --- docs/colors-and-icons.md | 11 +++++++++-- src/components/Map/Map.js | 20 +++++--------------- src/components/Map/images/customMarker.png | Bin 875 -> 0 bytes src/components/Map/images/marker.png | Bin 0 -> 1484 bytes 4 files changed, 14 insertions(+), 17 deletions(-) delete mode 100644 src/components/Map/images/customMarker.png create mode 100644 src/components/Map/images/marker.png 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 9d12f8488e4f6db008c9a60805a5c50762d73e88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 875 zcmV-x1C;!UP)itE5FmLGYBMX{zE+e^R9fEqG8+g4MS4$GkVrKHc;sc`4#v zX6Bo3W@mP17r|jg{oY;z*nj{L)U><7{^6Gnw1N=F<*%5(?vP2)qdW*Wpb635I56^D zVM|HjqPy1v|rlSvwT)_a{>J7xf#mPAC@>=d9d9=S?`CQm8bF0G4->fYmIQnzvl z0j*@>HNN!{g*i#Sw2z@gvL@Guul8&$ok`74aFwevPDC!4w2Zxk;zrGh}dFr;N7-nRjF!NoR?5?RYFTASNg+z zr66Ruz~a$(#~;a#P;6uZ$ZRS=%Yubbf&vLYXQ9gAR)hwJ1M$)C65^e!__TiT0H+lt zS8@>x4J+4wla8eiQ`wncDmXB5!JgPOjFXC#EBUdU;NCeGFU0OLUvaCQ^T%OB zVt(W|Izidx>}EN^z1Z##2-{G%NJlX|%QuNuO+Kq7hD7H+9|NhL~6O!lvVtU&J%W50 z7^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+081LL^>pAc7|f&-S?2Q9Vt zTWTK$F?4|3Q8W}o;Q#;s?zI_#SX~_h$M2`sfLvCq4X;J;cMxZ?7eNPw15R22LlV3**1qvLiyr`tp z72?7aqvdk_iiv}OmL99<%Bj<4P4~H^cVp_67kMiyJ@=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