Skip to content

Commit

Permalink
feat(location overview): new icon for own position
Browse files Browse the repository at this point in the history
SVA-298
  • Loading branch information
Julian Kwast committed Oct 25, 2021
1 parent 5bd09cc commit cc0b035
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/map/LocationOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MapMarker, WebviewLeafletMessage } from 'react-native-webview-leaflet';

import { colors, texts } from '../../config';
import { graphqlFetchPolicy } from '../../helpers';
import { location, locationIconAnchor } from '../../icons';
import { location, locationIconAnchor, ownLocation, ownLocationIconAnchor } from '../../icons';
import { NetworkContext } from '../../NetworkProvider';
import { getQuery, QUERY_TYPES } from '../../queries';
import { LoadingContainer } from '../LoadingContainer';
Expand Down Expand Up @@ -100,8 +100,8 @@ export const LocationOverview = ({

position &&
mapMarkers?.push({
icon: location(colors.accent),
iconAnchor: locationIconAnchor,
icon: ownLocation(colors.accent),
iconAnchor: ownLocationIconAnchor,
position: {
lat: position.coords.latitude,
lng: position.coords.longitude
Expand Down
1 change: 1 addition & 0 deletions src/icons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export * from './oParlCalendar';
export * from './oParlOrganizations';
export * from './oParlPeople';
export * from './oParlSearch';
export * from './ownLocation';
export * from './phone';
export * from './service';
export * from './share';
Expand Down
11 changes: 11 additions & 0 deletions src/icons/ownLocation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const ownLocation = (color) => `
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icons/ eigenerStandort</title>
<g id="icons/-eigenerStandort" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M12,1 C7.576,1 3,4.366 3,10 C3,15.289 10.951,23.363 11.29,23.705 C11.478,23.894 11.733,24 12,24 C12.267,24 12.522,23.894 12.71,23.705 C13.049,23.363 21,15.289 21,10 C21,4.366 16.424,1 12,1 Z M12,6 C13.105,6 14,6.895 14,8 C14,9.105 13.105,10 12,10 C10.895,10 10,9.105 10,8 C10,6.895 10.895,6 12,6 Z M8,14 C8,12.343 9.343,11 11,11 L13,11 C14.657,11 16,12.343 16,14 L8,14 Z" id="Shape" fill="${color}"></path>
</g>
</svg>
`;

export const ownLocationIconAnchor = { x: 6, y: 22 };

0 comments on commit cc0b035

Please sign in to comment.