All files / si-map/shared/themes marker.ts

66.66% Statements 2/3
100% Branches 0/0
0% Functions 0/1
66.66% Lines 2/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100              2x                                                                                                                                                           2x                            
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { MarkerStatusType } from '../../models/map-point.interface';
import { ThemeType } from './element';
 
const markers: Record<MarkerStatusType, string> = {
  default: `
    <path class="icon"
      d="m256,64c-69.37,0-125.8,56.43-125.8,125.8,0,1.44.04,2.95.12,4.62.46,12.87,2.86,25.46,7.1,37.44,24.76,81.02,105.75,183.3,109.19,187.62,2.28,2.86,5.73,4.52,9.39,4.52s7.11-1.67,9.39-4.52c3.44-4.32,84.44-106.59,109.2-187.62,4.25-11.99,6.64-24.57,7.1-37.41.08-1.51.12-3.07.12-4.64,0-69.37-56.44-125.8-125.81-125.8Z" />
    <path class="middle"
      d="m255.99,277.81c-48.59,0-87.99-39.4-87.99-88.01s39.4-87.99,87.99-87.99,88.01,39.41,88.01,87.99-39.39,88.01-88.01,88.01Z" />
`,
  success: `
    <path class="icon"
      d="m256,64c-69.37,0-125.8,56.43-125.8,125.8,0,1.44.04,2.95.12,4.62.46,12.87,2.86,25.46,7.1,37.44,24.76,81.02,105.75,183.3,109.19,187.62,2.28,2.86,5.73,4.52,9.39,4.52s7.11-1.67,9.39-4.52c3.44-4.32,84.44-106.59,109.2-187.62,4.25-11.99,6.64-24.57,7.1-37.41.08-1.51.12-3.07.12-4.64,0-69.37-56.44-125.8-125.81-125.8Zm0,213.81c-48.59,0-87.99-39.4-87.99-88.01s39.4-87.99,87.99-87.99,88.01,39.41,88.01,87.99-39.39,88.01-88.01,88.01Z" />
    <path class="middle"
      d="m255.99,277.81c-48.59,0-87.99-39.4-87.99-88.01s39.4-87.99,87.99-87.99,88.01,39.41,88.01,87.99-39.39,88.01-88.01,88.01Z" />
    <path class="symbol"
      d="m241.55,225.45c-2.47,0-4.93-.94-6.82-2.82l-24.09-24.09c-3.77-3.77-3.77-9.86,0-13.63,3.77-3.77,9.87-3.77,13.63,0l17.28,17.28,46.19-46.19c3.77-3.77,9.87-3.77,13.63,0,3.77,3.77,3.77,9.86,0,13.63l-53.01,53.01c-1.88,1.88-4.35,2.82-6.82,2.82h.02Z" />
  `,
  info: `
    <path class="icon"
      d="m256,64c-69.37,0-125.8,56.43-125.8,125.8,0,1.44.04,2.95.12,4.62.46,12.87,2.86,25.46,7.1,37.44,24.76,81.02,105.75,183.3,109.19,187.62,2.28,2.86,5.73,4.52,9.39,4.52s7.11-1.67,9.39-4.52c3.44-4.32,84.44-106.59,109.2-187.62,4.25-11.99,6.64-24.57,7.1-37.41.08-1.51.12-3.07.12-4.64,0-69.37-56.44-125.8-125.81-125.8Z" />
    <rect class="middle"
      x="177.74" y="110.96" width="156.52" height="156.52" rx="11.74" ry="11.74" />
    <path class="symbol"
      d="m255.91,134.43h.18c7.02,0,12.72,5.73,12.72,12.81s-5.69,12.81-12.72,12.81h-.18c-7.02,0-12.72-5.73-12.72-12.81s5.69-12.81,12.72-12.81Z" />
    <path class="symbol"
      d="m256,179.94c5.31,0,9.61,4.3,9.61,9.61v44.84c0,5.31-4.3,9.61-9.61,9.61s-9.61-4.3-9.61-9.61v-44.84c0-5.31,4.3-9.61,9.61-9.61Z" />
  `,
  warning: `
    <path class="icon"
      d="m256,64c-69.37,0-125.8,56.43-125.8,125.8,0,1.44.04,2.95.12,4.62.46,12.87,2.86,25.46,7.1,37.44,24.76,81.02,105.75,183.3,109.19,187.62,2.28,2.86,5.73,4.52,9.39,4.52s7.11-1.67,9.39-4.52c3.44-4.32,84.44-106.59,109.2-187.62,4.25-11.99,6.64-24.57,7.1-37.41.08-1.51.12-3.07.12-4.64,0-69.37-56.44-125.8-125.81-125.8Z" />
    <path class="middle"
      d="m243.78,104.22l-76.92,134.35c-5.38,9.39,1.4,21.09,12.22,21.09h153.85c10.82,0,17.6-11.7,12.22-21.09l-76.92-134.35c-5.41-9.45-19.04-9.45-24.45,0Z" />
    <path class="symbol"
      d="m256.09,244.09h-.18c-7.02,0-12.72-5.73-12.72-12.81s5.69-12.81,12.72-12.81h.18c7.02,0,12.72,5.73,12.72,12.81s-5.69,12.81-12.72,12.81Z" />
    <path class="symbol"
      d="m256,198.59c-5.31,0-9.61-4.3-9.61-9.61v-44.84c0-5.31,4.3-9.61,9.61-9.61s9.61,4.3,9.61,9.61v44.84c0,5.31-4.3,9.61-9.61,9.61Z" />
  `,
  danger: `
    <path class="icon"
      d="m256,64c-69.05,0-125.21,56.17-125.21,125.21,0,1.43.04,2.94.12,4.6.46,12.81,2.85,25.34,7.07,37.27,24.64,80.64,105.26,184.13,108.68,188.43,2.27,2.85,5.7,4.5,9.35,4.5s7.08-1.66,9.35-4.5c3.42-4.3,84.05-107.77,108.69-188.43,4.23-11.93,6.61-24.46,7.07-37.24.08-1.5.12-3.06.12-4.62,0-69.05-56.18-125.21-125.22-125.21h0Z" />
    <path class="middle"
      d="m255.99,277.81c-48.59,0-87.99-39.4-87.99-88.01s39.4-87.99,87.99-87.99,88.01,39.41,88.01,87.99-39.39,88.01-88.01,88.01Z" />
    <path class="symbol"
      d="m256.09,244.09h-.18c-7.02,0-12.72-5.73-12.72-12.81s5.69-12.81,12.72-12.81h.18c7.02,0,12.72,5.73,12.72,12.81s-5.69,12.81-12.72,12.81Z" />
    <path class="symbol"
      d="m256,198.59c-5.31,0-9.61-4.3-9.61-9.61v-44.84c0-5.31,4.3-9.61,9.61-9.61s9.61,4.3,9.61,9.61v44.84c0,5.31-4.3,9.61-9.61,9.61Z" />
  `,
  caution: `
    <path class="icon"
      d="m256,64c-69.37,0-125.8,56.43-125.8,125.8,0,1.44.04,2.95.12,4.62.46,12.87,2.86,25.46,7.1,37.44,24.76,81.02,105.75,183.3,109.19,187.62,2.28,2.86,5.73,4.52,9.39,4.52s7.11-1.67,9.39-4.52c3.44-4.32,84.44-106.59,109.2-187.62,4.25-11.99,6.64-24.57,7.1-37.41.08-1.51.12-3.07.12-4.64,0-69.37-56.44-125.8-125.81-125.8Z" />
    <rect class="middle"
       x="190.26" y="123.48" width="131.47" height="131.47" rx="11.74" ry="11.74"
      transform="translate(208.78 -125.6) rotate(45)" />
    <path class="symbol"
      d="m256.09,244h-.18c-7.02,0-12.72-5.73-12.72-12.81,0-7.08,5.69-12.81,12.72-12.81h.18c7.02,0,12.72,5.73,12.72,12.81,0,7.08-5.69,12.81-12.72,12.81Z" />
    <path class="symbol"
      d="m256,198.5c-5.31,0-9.61-4.3-9.61-9.61v-44.84c0-5.31,4.3-9.61,9.61-9.61,5.31,0,9.61,4.3,9.61,9.61v44.84c0,5.31-4.3,9.61-9.61,9.61Z" />
  `,
  critical: `
    <path class="icon"
        d="m256,64c-69.37,0-125.8,56.43-125.8,125.8,0,1.44.04,2.95.12,4.62.46,12.87,2.86,25.46,7.1,37.44,24.76,81.02,105.75,183.3,109.19,187.62,2.28,2.86,5.73,4.52,9.39,4.52s7.11-1.67,9.39-4.52c3.44-4.32,84.44-106.59,109.2-187.62,4.25-11.99,6.64-24.57,7.1-37.41.08-1.51.12-3.07.12-4.64,0-69.37-56.44-125.8-125.81-125.8Z" />
    <path class="middle"
        d="m285.78,105.57h-59.57c-3.11,0-6.1,1.24-8.3,3.44l-42.12,42.12c-2.2,2.2-3.44,5.19-3.44,8.3v59.57c0,3.11,1.24,6.1,3.44,8.3l42.12,42.12c2.2,2.2,5.19,3.44,8.3,3.44h59.57c3.11,0,6.1-1.24,8.3-3.44l42.12-42.12c2.2-2.2,3.44-5.19,3.44-8.3v-59.57c0-3.11-1.24-6.1-3.44-8.3l-42.12-42.12c-2.2-2.2-5.19-3.44-8.3-3.44Z" />
    <path class="symbol"
        d="m256.09,244h-.18c-7.02,0-12.72-5.73-12.72-12.81,0-7.08,5.69-12.81,12.72-12.81h.18c7.02,0,12.72,5.73,12.72,12.81,0,7.08-5.69,12.81-12.72,12.81Z" />
    <path class="symbol"
        d="m256,198.5c-5.31,0-9.61-4.3-9.61-9.61v-44.84c0-5.31,4.3-9.61,9.61-9.61,5.31,0,9.61,4.3,9.61,9.61v44.84c0,5.31-4.3,9.61-9.61,9.61Z" />
  `,
  unknown: `
    <path class="icon"
      d="m256,64c-69.37,0-125.8,56.43-125.8,125.8,0,1.44.04,2.95.12,4.62.46,12.87,2.86,25.46,7.1,37.44,24.76,81.02,105.75,183.3,109.19,187.62,2.28,2.86,5.73,4.52,9.39,4.52s7.11-1.67,9.39-4.52c3.44-4.32,84.44-106.59,109.2-187.62,4.25-11.99,6.64-24.57,7.1-37.41.08-1.51.12-3.07.12-4.64,0-69.37-56.44-125.8-125.81-125.8Zm0,213.81c-48.59,0-87.99-39.4-87.99-88.01s39.4-87.99,87.99-87.99,88.01,39.41,88.01,87.99-39.39,88.01-88.01,88.01Z" />
    <path class="middle"
      d="m255.99,277.81c-48.59,0-87.99-39.4-87.99-88.01s39.4-87.99,87.99-87.99,88.01,39.41,88.01,87.99-39.39,88.01-88.01,88.01Z" />
    <path class="symbol"
      d="m256.04,207.64h0c-5.25,0-9.5-4.25-9.5-9.5v-9.95c0-3.59,1.8-7,4.87-8.86.59-.36,1.07-.56,1.58-.73,5.75-1.99,17.59-8.4,17.59-15.59,0-6.46-4.07-12.24-10.16-14.38-7.91-2.78-16.6,1.39-19.38,9.29-1.74,4.95-7.16,7.55-12.11,5.81-4.95-1.74-7.55-7.17-5.81-12.11,6.26-17.79,25.82-27.17,43.61-20.91,13.69,4.82,22.87,17.8,22.85,32.31,0,16.73-14.98,26.5-24.04,30.88v4.23c0,5.25-4.25,9.5-9.5,9.5h0Z" />
    <path class="symbol"
      d="m256.09,247h-.18c-7.02,0-12.72-5.73-12.72-12.81,0-7.08,5.69-12.81,12.72-12.81h.18c7.02,0,12.72,5.73,12.72,12.81,0,7.08-5.69,12.81-12.72,12.81Z" />
 `
};
 
export const getMarker = (status: MarkerStatusType, theme: ThemeType): string => {
  return `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="64" height="64">
  <defs>
    <style>
      .middle{fill:${theme.fillColor};}
      .symbol{fill:${theme.textColor};}
      .icon{fill:${theme.status[status]};}
    </style>
  </defs>
  ${markers[status]}
</svg>
`;
};