Skip to content

Commit b7efc93

Browse files
committed
use @mdi/font instead of @material-design-icons/font, rename road font to lobsta_road
1 parent 8b1d70c commit b7efc93

File tree

12 files changed

+7321
-2257
lines changed

12 files changed

+7321
-2257
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"homepage": "https://github.com/gtt-project/redmine_gtt#readme",
2222
"dependencies": {
2323
"@juggle/resize-observer": "^3.4.0",
24-
"@material-design-icons/font": "^0.14.9",
24+
"@mdi/font": "^7.2.96",
2525
"fontfaceobserver": "^2.3.0",
2626
"geojson": "^0.5.0",
2727
"ol": "^7.4.0",

src/components/gtt-client/geocoding/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export function setGeocoding(currentMap: Map):void {
186186

187187
// Control button
188188
const geocodingCtrl = new Toggle({
189-
html: '<i class="material-icons">manage_search</i>',
189+
html: '<i class="mdi mdi-map-search-outline"></i>',
190190
title: this.i18n.control.geocoding,
191191
className: "ctl-geocoding",
192192
onToggle: (active: boolean) => {

src/components/gtt-client/init/controls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function addFullScreenAndRotateControls(instance: any): void {
4444
*/
4545
function addMaximizeControl(instance: any): void {
4646
const maximizeCtrl = new Button({
47-
html: '<i class="material-icons">zoom_out_map</i>',
47+
html: '<i class="mdi mdi-arrow-expand-all"></i>',
4848
title: instance.i18n.control.maximize,
4949
handleClick: () => {
5050
zoomToExtent.call(instance, true);

src/components/gtt-client/openlayers/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,20 @@ export function setControls(types: Array<string>) {
180180
})
181181

182182
// Material design icon
183-
let mdi = 'place'
183+
let mdi = 'mdi-map-marker-outline'
184184

185185
switch (type.toLowerCase()) {
186186
case 'linestring':
187-
mdi = 'polyline'
187+
mdi = 'mdi-vector-polyline'
188188
break;
189189

190190
case 'polygon':
191-
mdi = 'format_shapes'
191+
mdi = 'mdi-vector-polygon'
192192
break;
193193
}
194194

195195
const control = new Toggle({
196-
html: `<i class="material-icons" >${mdi}</i>`,
196+
html: `<i class="mdi ${mdi}" ></i>`,
197197
title: this.i18n.control[type.toLowerCase()],
198198
interaction: draw,
199199
active: (type === geometryType)
@@ -252,7 +252,7 @@ export function setControls(types: Array<string>) {
252252
});
253253

254254
editbar.addControl(new Button({
255-
html: '<i class="material-icons">file_upload</i>',
255+
html: '<i class="mdi mdi-file-upload"></i>',
256256
title: this.i18n.control.upload,
257257
handleClick: () => {
258258
dialog.dialog('open')
@@ -465,7 +465,7 @@ export function setGeolocation(currentMap: Map) {
465465

466466
// Control button
467467
const geolocationCtrl = new Toggle({
468-
html: '<i class="material-icons">my_location</i>',
468+
html: '<i class="mdi mdi-crosshairs-gps"></i>',
469469
title: this.i18n.control.geolocation,
470470
active: false,
471471
onToggle: (active: boolean) => {

src/components/gtt-settings/processElement.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ export const processElement = (element: HTMLSelectElement): void => {
3030
if (selected) {
3131
const style = fonts[fontKey].font.toLowerCase().replace(/\s+/g, '-');
3232
const icon = element.nextElementSibling;
33-
icon.className = `${style}${style === 'material-icons' ? '' : ' icon-' + glyphKey}`;
34-
icon.textContent = style === 'material-icons' ? glyphKey : '';
33+
icon.className = `${style}${style === 'material-design-icons' ? ' mdi mdi-' + glyphKey : ' icon-' + glyphKey}`;
3534
}
3635
}
3736
}
@@ -45,8 +44,7 @@ export const processElement = (element: HTMLSelectElement): void => {
4544
change: function (event: any, data: any) {
4645
const style = data.item.optgroup.toLowerCase().replace(/\s+/g, '-');
4746
const icon = document.querySelector(`#icon_${element.id}`);
48-
icon.className = `${style}${style === 'material-icons' ? '' : ' icon-' + data.item.value}`;
49-
icon.textContent = style === 'material-icons' ? data.item.value : '';
47+
icon.className = `${style}${style === 'material-design-icons' ? ' mdi mdi-' + data.item.value : ' icon-' + data.item.value}`;
5048
},
5149
})
5250
.selectmenu('menuWidget')

src/components/gtt-settings/selectMenuOverride.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ export const overrideSelectMenu = (): void => {
1515
const wrapper = $('<div>', { text: '' });
1616
const style = item.optgroup.toLowerCase().replace(/\s+/g, '-');
1717

18-
const isMaterialIconsStyle = style === 'material-icons';
19-
const iconClass = `ui-icons ${style}${isMaterialIconsStyle ? '' : ' icon-' + item.value}`;
18+
const isMaterialIconsStyle = style === 'material-design-icons';
19+
const iconClass = `ui-icons ${style}${isMaterialIconsStyle ? ' mdi mdi-' + item.value : ' icon-' + item.value}`;
2020

2121
const iconConfig = {
2222
class: iconClass,
2323
title: item.label,
24-
text: isMaterialIconsStyle ? item.value : '',
2524
};
2625

2726
$('<i>', iconConfig).prependTo(wrapper);

src/styles/icons/custom/custom-icons-def.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import FontSymbol from 'ol-ext/style/FontSymbol';
44
const iconMappings: { [key: string]: any } = {
55
'lobsta': '\uf101',
66
'park_bench': '\uf102',
7-
'road': '\uf103',
7+
'lobsta_road': '\uf103',
88
'waste': '\uf104'
99
};
1010

src/styles/icons/custom/custom-icons.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ i[class*=" icon-"]:before {
4040
.icon-park_bench:before {
4141
content: "\f102";
4242
}
43-
.icon-road:before {
43+
.icon-lobsta_road:before {
4444
content: "\f103";
4545
}
4646
.icon-waste:before {

0 commit comments

Comments
 (0)