UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

78 lines 2.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const COURIER_ICON_SIZE_X = 41; const COURIER_ICON_SIZE_Y = 24; const COURIER_ICON_ANCHOR_X = COURIER_ICON_SIZE_X / 2; const COURIER_ICON_ANCHOR_Y = COURIER_ICON_SIZE_Y; const courierIdle = require(`../assets/courier_idle_${COURIER_ICON_SIZE_X}.png`); const courierBusy = require(`../assets/courier_busy_${COURIER_ICON_SIZE_X}.png`); // defaults to 58-62 Scrutton Street, London EC2A 4PH exports.defaultBounds = { lat: 51.52332879999999, lng: -0.0804359999999682, zoom: 12, }; /** * A note on the zIndexLength property * In order to prevent the icon labels overlapping * we need to assign each courier a random z-index * In order to give some icons a higher z index than others * we create a random number with a given length * Be aware that the max value of a z index is 2147483647 * So a zIndexLength that is greater than 9 is forbidden */ exports.icons = () => ({ courier: { zIndexLength: 4, url: courierIdle, labelOrigin: new google.maps.Point(19, 9), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(COURIER_ICON_ANCHOR_X, COURIER_ICON_ANCHOR_Y), }, activeCourier: { zIndexLength: 5, url: courierBusy, labelOrigin: new google.maps.Point(19, 9), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(COURIER_ICON_ANCHOR_X, COURIER_ICON_ANCHOR_Y), }, job: { fillColor: '#32c5a1', fillOpacity: 0.8, path: 'M 0 11.33 L 6.22 14.05 6.22 6.81 0 4.54 0 11.33 M 7.85 6.81 L 7.85 14.05 14.06 11.33 14.06 4.54 7.85 6.81 M 7.02 0 L 0.01 2.83 7.02 5.41 14.02 2.83 7.02 0', scale: 1, strokeColor: '#32c5a1', strokeWeight: 0.1, zIndexLength: 6, }, activeJob: { fillColor: '#000000', fillOpacity: 1, path: 'M 0 11.33 L 6.22 14.05 6.22 6.81 0 4.54 0 11.33 M 7.85 6.81 L 7.85 14.05 14.06 11.33 14.06 4.54 7.85 6.81 M 7.02 0 L 0.01 2.83 7.02 5.41 14.02 2.83 7.02 0', scale: 1, strokeColor: '#ffffff', strokeWeight: 0.1, zIndexLength: 7, }, serviceCentre: { fillColor: '#0CB', fillOpacity: 1, path: 'M24-8c0 4.4-3.6 8-8 8h-32c-4.4 0-8-3.6-8-8v-32c0-4.4 3.6-8 8-8h32c4.4 0 8 3.6 8 8v32z', scale: 0.3, strokeColor: '#0CB', strokeWeight: 1, zIndexLength: 4, }, }); const defaults = { serviceCentre: { fillColor: '#00B0D0', fillOpacity: 0.15, strokeColor: '#00B0D0', strokeOpacity: 0.5, strokeWeight: 1, paths: [], }, }; exports.makeShapeForType = (type) => (Object.assign({}, defaults[type], { paths: [] })); //# sourceMappingURL=mapping.js.map