Skip to content

Commit 429514a

Browse files
author
matafokka
committed
Better labels for when loading geometry is not supported
Also restored initial map view back to London
1 parent 88f48b4 commit 429514a

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

SynthGeometryBaseWizard.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ const shp = require("shpjs");
88
L.ALS.SynthGeometryBaseWizard = L.ALS.Wizard.extend(/** @lends L.ALS.SynthGeometryBaseWizard.prototype */{
99

1010
fileLabel: "geometryFileLabel",
11+
browserNotSupportedLabel: "initialFeaturesBrowserNotSupported",
1112

1213
initialize: function () {
1314

1415
L.ALS.Wizard.prototype.initialize.call(this);
1516
if (!window.FileReader) {
16-
this.addWidget(new L.ALS.Widgets.SimpleLabel("lbl", "geometryBrowserNotSupported", "center", "error"));
17+
this.addWidget(new L.ALS.Widgets.SimpleLabel("lbl", this.browserNotSupportedLabel, "center", "error"));
1718
return;
1819
}
1920

SynthGeometryLayer/SynthGeometryWizard.js

+3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
L.ALS.SynthGeometryWizard = L.ALS.SynthGeometryBaseWizard.extend( /** @lends L.ALS.SynthGeometryWizard.prototype */ {
77

88
displayName: "geometryDisplayName",
9+
browserNotSupportedLabel: "geometryBrowserNotSupported",
910

1011
initialize: function () {
1112
L.ALS.SynthGeometryBaseWizard.prototype.initialize.call(this);
13+
if (!window.FileReader)
14+
return;
1215

1316
this.addWidget(
1417
new L.ALS.Widgets.SimpleLabel("geometryNotification", "geometryNotification", "center", "message")

locales/English.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ L.ALS.Locales.addLocaleProperties("English", {
146146
geometryNoFeatures: "Selected file doesn't contain any features, so it won't be added",
147147
geometryBorderColor: "Border color:",
148148
geometryFillColor: "Fill color:",
149-
geometryBrowserNotSupported: "Your browser doesn't support adding this layer. You still can open projects with this layer though.",
149+
geometryBrowserNotSupported: "Sorry, your browser doesn't support adding this layer. You still can open projects with this layer though.",
150150
geometryNoFileSelected: "No file has been selected. Please, select a file that you want to add and try again.",
151151
geometryProjectionNotSupported: "Sorry, projection of selected file is not supported. Please, convert your file to another projection, preferably, WebMercator.",
152152

@@ -167,6 +167,7 @@ L.ALS.Locales.addLocaleProperties("English", {
167167
generalSettingsDisableAnnoyingNotification: "Disable all annoying notifications after editing and DEM loading",
168168

169169
// GeoJSON initial features
170+
initialFeaturesBrowserNotSupported: "Sorry, your browser doesn't support loading initial geometry for this layer. You still can draw geometry yourself though.",
170171
initialFeaturesFileLabelPolygon: "Load initial polygons from zipped shapefile or GeoJSON (non-polygon features will be skipped):",
171172
initialFeaturesFileLabelLine: "Load initial polylines from zipped shapefile or GeoJSON (non-polyline features will be skipped):",
172173
initialFeaturesNoFeatures: "Selected file doesn't contain any features supported by the added layer",

locales/Russian.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ L.ALS.Locales.addLocaleProperties("Русский", {
142142
geometryNoFeatures: "Выбранный файл не содержит объектов, поэтому не будет добавлен",
143143
geometryBorderColor: "Цвет обводки:",
144144
geometryFillColor: "Цвет заливки:",
145-
geometryBrowserNotSupported: "Ваш браузер не поддерживает добавление данного слоя, но вы можете открывать проекты, использующие этот слой.",
145+
geometryBrowserNotSupported: "Извините, ваш браузер не поддерживает добавление данного слоя, но вы можете открывать проекты, использующие этот слой.",
146146
geometryNoFileSelected: "Файл не был выбран. Пожалуйста, выберете файл, который хотите добавить, и попробуйте снова.",
147147
geometryProjectionNotSupported: "Извините проекция выбранного файла не поддерживается. Пожалуйста, переконвертируйте файл в другую проекцию, предпочтительно, в WebMercator.",
148148

@@ -163,6 +163,7 @@ L.ALS.Locales.addLocaleProperties("Русский", {
163163
generalSettingsDisableAnnoyingNotification: "Отключить все надоедливые уведомления после редактирования и загрузки ЦМР",
164164

165165
// GeoJSON initial features
166+
initialFeaturesBrowserNotSupported: "Извините, ваш браузер не поддерживает загрузку исходной геометрии для данного слоя, но вы все равно можете нарисовать геомтрию вручную.",
166167
initialFeaturesFileLabelPolygon: "Загрузить исходные полигоны из сжатого shapefile (zip-архива) или GeoJSON (типы, отличные от полигона, будут пропущены):",
167168
initialFeaturesFileLabelLine: "Загрузить исходные полилинии из сжатого shapefile (zip-архива) или GeoJSON (типы, отличные от пололинии, будут пропущены):",
168169
initialFeaturesNoFeatures: "Выбранный файл не содержит ни одного объекта, поддерживаемого добавляемым слоем",

main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ let map = L.map("map", {
6363
keyboard: false,
6464
worldCopyJump: true,
6565
fadeAnimation: false
66-
}).setView([55.75, 37.61], 13);
66+
}).setView([51.505, -0.09], 13);
6767
map.doubleClickZoom.disable();
6868

6969

7070
// Display a notification that users can move the map farther to jump to the other side of the world
7171

72-
let labelLayer = new L.ALS.LeafletLayers.LabelLayer(false), maxLabelWidth = 3,
72+
let labelLayer = new L.ALS.LeafletLayers.LabelLayer(false),
7373
labelOpts = {
7474
maxWidth: 10,
7575
breakWords: false,

0 commit comments

Comments
 (0)