proximiio-js-library 1.9.4 → 1.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/lib/components/map/main.d.ts +1 -0
- package/lib/components/map/main.js +12 -9
- package/lib/proximiio.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -140,6 +140,11 @@ const map = new Proximiio.Map({
|
|
|
140
140
|
defaultLabelColor: string; // optional, default: '#6945ed', default color of the polygon labels
|
|
141
141
|
hoverLabelColor: string; // optional, default: '#fff', hover color of the polygon labels
|
|
142
142
|
selectedLabelColor: string; // optional, default: '#fff', selected color of the polygon labels
|
|
143
|
+
defaultPolygonHeight: number; // optional, default: 3, default polygon height in meters
|
|
144
|
+
hoverPolygonHeight: number; // optional, default: 3, hover polygon height in meters
|
|
145
|
+
selectedPolygonHeight: number; // optional, default: 3, selected polygon height in meters
|
|
146
|
+
base: number; // optional, default: 0, default polygon base in meters
|
|
147
|
+
opacity: number; // optional, default: 1, default polygon opacity
|
|
143
148
|
}
|
|
144
149
|
considerVisibilityParam: false, // optional, default: true, if enabled all pois with visibility property defined as 'hidden' will not be visible as default, will be possible to toggle them with toggleHiddenPois() method
|
|
145
150
|
fitBoundsPadding: 200, // optional, default 250, number | PaddingOptions, the amount of padding in pixels to add to the given bounds for found route, https://docs.mapbox.com/mapbox-gl-js/api/properties/#paddingoptions
|
|
@@ -160,6 +160,7 @@ var Map = /** @class */ (function () {
|
|
|
160
160
|
this.filteredFeatures = [];
|
|
161
161
|
this.hiddenFeatures = [];
|
|
162
162
|
this.filteredAmenities = [];
|
|
163
|
+
this.amenityFilters = [];
|
|
163
164
|
this.hiddenAmenities = [];
|
|
164
165
|
this.amenityCategories = {};
|
|
165
166
|
// Used to increment the value of the point measurement against the route.
|
|
@@ -948,17 +949,18 @@ var Map = /** @class */ (function () {
|
|
|
948
949
|
for (var key in this.amenityCategories) {
|
|
949
950
|
_loop_3(key);
|
|
950
951
|
}
|
|
951
|
-
this.
|
|
952
|
+
this.amenityFilters = this.amenityIds.filter(function (el) { return !amenities_1.includes(el); });
|
|
952
953
|
}
|
|
953
954
|
else {
|
|
954
955
|
if (inverted && this.hiddenAmenities.findIndex(function (i) { return i === amenityId; }) === -1) {
|
|
955
956
|
this.hiddenAmenities.push(amenityId);
|
|
956
957
|
this.filteredAmenities = this.filteredAmenities.filter(function (i) { return i !== amenityId; });
|
|
957
958
|
}
|
|
958
|
-
else if (!inverted && this.
|
|
959
|
-
this.
|
|
959
|
+
else if (!inverted && this.amenityFilters.findIndex(function (i) { return i === amenityId; }) === -1) {
|
|
960
|
+
this.amenityFilters.push(amenityId);
|
|
960
961
|
}
|
|
961
962
|
}
|
|
963
|
+
this.filteredAmenities = this.amenityFilters;
|
|
962
964
|
this.filterOutFeatures();
|
|
963
965
|
if (!inverted)
|
|
964
966
|
this.setActivePolygons(amenityId);
|
|
@@ -971,7 +973,7 @@ var Map = /** @class */ (function () {
|
|
|
971
973
|
this.amenityCategories[category].active &&
|
|
972
974
|
this.amenityCategories[category].activeId === amenityId) {
|
|
973
975
|
var amenities = this.amenityCategories[category].amenities.filter(function (i) { return i !== amenityId; });
|
|
974
|
-
this.
|
|
976
|
+
this.amenityFilters = this.amenityFilters.concat(amenities);
|
|
975
977
|
this.amenityCategories[category].active = false;
|
|
976
978
|
}
|
|
977
979
|
else if (!category) {
|
|
@@ -981,22 +983,23 @@ var Map = /** @class */ (function () {
|
|
|
981
983
|
this.filteredAmenities.push(amenityId);
|
|
982
984
|
}
|
|
983
985
|
else {
|
|
984
|
-
this.
|
|
986
|
+
this.amenityFilters = this.amenityFilters.filter(function (i) { return i !== amenityId; });
|
|
985
987
|
}
|
|
986
988
|
}
|
|
987
|
-
this.filteredAmenities = this.
|
|
989
|
+
this.filteredAmenities = this.amenityFilters.length > 0 ? this.amenityFilters : this.amenityIds;
|
|
988
990
|
this.hiddenAmenities = this.hiddenAmenities.length > 0 ? this.hiddenAmenities : [];
|
|
989
991
|
this.filterOutFeatures();
|
|
990
992
|
this.setActivePolygons(null);
|
|
991
993
|
};
|
|
992
994
|
Map.prototype.onResetAmenityFilters = function () {
|
|
993
|
-
this.
|
|
995
|
+
this.amenityFilters = [];
|
|
994
996
|
this.hiddenAmenities = [];
|
|
995
997
|
for (var key in this.amenityCategories) {
|
|
996
998
|
if (this.amenityCategories.hasOwnProperty(key)) {
|
|
997
999
|
this.amenityCategories[key].active = false;
|
|
998
1000
|
}
|
|
999
1001
|
}
|
|
1002
|
+
this.filteredAmenities = this.amenityIds;
|
|
1000
1003
|
this.filterOutFeatures();
|
|
1001
1004
|
this.setActivePolygons(null);
|
|
1002
1005
|
};
|
|
@@ -1081,7 +1084,7 @@ var Map = /** @class */ (function () {
|
|
|
1081
1084
|
: [];
|
|
1082
1085
|
if (activeFeatures.length > 0) {
|
|
1083
1086
|
var _loop_4 = function (f) {
|
|
1084
|
-
var polygon = this_4.state.allFeatures.features.find(function (i) { return i.properties.id === f.properties.metadata.polygon_id; });
|
|
1087
|
+
var polygon = this_4.state.allFeatures.features.find(function (i) { return i.properties.id === f.properties.metadata.polygon_id && i.properties.type === 'shop-custom'; });
|
|
1085
1088
|
if (polygon) {
|
|
1086
1089
|
this_4.map.setFeatureState({
|
|
1087
1090
|
source: 'main',
|
|
@@ -1099,7 +1102,7 @@ var Map = /** @class */ (function () {
|
|
|
1099
1102
|
}
|
|
1100
1103
|
if (amenityFeatures.length > 0) {
|
|
1101
1104
|
var _loop_5 = function (f) {
|
|
1102
|
-
var polygon = this_5.state.allFeatures.features.find(function (i) { return i.properties.id === f.properties.metadata.polygon_id; });
|
|
1105
|
+
var polygon = this_5.state.allFeatures.features.find(function (i) { return i.properties.id === f.properties.metadata.polygon_id && i.properties.type === 'shop-custom'; });
|
|
1103
1106
|
if (polygon) {
|
|
1104
1107
|
this_5.map.setFeatureState({
|
|
1105
1108
|
source: 'main',
|