Commit 6a08d06b authored by Curtis Adam's avatar Curtis Adam

Merge branch '136-improve-the-visuals-for-category-icons' into 'develop'

Resolve "Improve the visuals for category icons"

Closes #136

See merge request !125
parents 5d398e11 bac665e3
Pipeline #30021 passed with stage
in 8 minutes and 24 seconds
......@@ -52,21 +52,34 @@ export const minZoomSelected = 19;
* @type {number}
*/
export const startZoomSelected = 20;
const icon = (url: string, retinaURL: string) => {
return L.icon({
iconUrl: url,
iconRetinaUrl: retinaURL,
shadowUrl: 'images/marker-shadow.png',
iconSize: [25, 41],
iconAnchor: [12, 41],
popupAnchor: [1, -34],
tooltipAnchor: [16, -28],
shadowSize: [41, 41],
});
const icon = (url: string, retinaURL: string, isCustomIcon: boolean) => {
if (isCustomIcon) {
return L.icon({
iconUrl: url,
iconRetinaUrl: retinaURL,
iconSize: [30, 30],
iconAnchor: [12, 41],
popupAnchor: [1, -34],
tooltipAnchor: [16, -28],
});
} else {
return L.icon({
iconUrl: url,
iconRetinaUrl: retinaURL,
shadowUrl: 'images/marker-shadow.png',
iconSize: [25, 41],
iconAnchor: [12, 41],
popupAnchor: [1, -34],
tooltipAnchor: [16, -28],
shadowSize: [41, 41],
});
}
};
export const iconForNavigationEndtype = (type: NavigationEndType) => {
return icon(`assets/navigationMarkers/${NavigationEndType[type]}.png`, `assets/navigationMarkers/${NavigationEndType[type]}-2x.png`);
const url = `assets/navigationMarkers/${NavigationEndType[type]}.png`;
const retinaUrl = `assets/navigationMarkers/${NavigationEndType[type]}-2x.png`;
return icon(url, retinaUrl, false);
};
export const instructionForNavigationEndTyoe = (type: NavigationEndType): string => {
......@@ -99,24 +112,28 @@ export const categoryIconNavigation = (url: string) => {
* @returns {Icon}
*/
export const redIcon = () => {
return icon('assets/red-marker-icon.png', 'assets/red-marker-icon-2x.png');
return icon('assets/red-marker-icon.png', 'assets/red-marker-icon-2x.png', false);
};
export const favIcon = () => {
return icon('assets/wifi.png', 'assets/wifi-2x.png');
return icon('assets/wifi.png', 'assets/wifi-2x.png', false);
};
export const aIcon = () => {
return icon('assets/navigationMarkers/a-marker-icon.png', 'assets/navigationMarkers/a-marker-icon-2x.png');
const url = 'assets/navigationMarkers/a-marker-icon.png';
const retinaUrl = 'assets/navigationMarkers/a-marker-icon-2x.png';
return icon(url, retinaUrl, false);
};
export const bIcon = () => {
return icon('assets/navigationMarkers/b-marker-icon.png', 'assets/navigationMarkers/b-marker-icon-2x.png');
const url = 'assets/navigationMarkers/b-marker-icon.png';
const retinaUrl = 'assets/navigationMarkers/b-marker-icon-2x.png';
return icon(url, retinaUrl, false);
};
export const categoryIcon = (url: string, retinaUrl: string) => {
if (url.trim().length) {
return icon(url, retinaUrl);
return icon(url, retinaUrl, true);
} else {
return redIcon();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment