@osimatic/helpers-js 1.1.73 → 1.1.75

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/location.js CHANGED
@@ -7,9 +7,12 @@ class Country {
7
7
  return '<span><img src="'+Country.getFlagPath(countryCode)+'" alt="" title="'+Country.getCountryName(countryCode)+'" class="flag" /></span>'
8
8
  }
9
9
 
10
- static fillCountrySelect(select, defaultValue=null) {
10
+ static fillCountrySelect(select, defaultValue=null, countriesList=null, addNoneValue=false, noneLabel='- Aucun -') {
11
11
  if (select.children().length === 0) {
12
- Object.entries(Country.getCountries()).forEach(([countryCode, countryName]) => select.append('<option value="' + countryCode + '">' + countryName + '</option>'));
12
+ if (addNoneValue) {
13
+ select.append('<option value="">'+noneLabel+'</option>');
14
+ }
15
+ Object.entries(null != countriesList ? countriesList : Country.getCountries()).forEach(([countryCode, countryName]) => select.append('<option value="' + countryCode + '">' + countryName + '</option>'));
13
16
  }
14
17
  if (null != defaultValue) {
15
18
  select.val(defaultValue);
@@ -26,6 +26,11 @@ class OpenStreetMap {
26
26
  return;
27
27
  }
28
28
 
29
+ let container = L.DomUtil.get(mapId);
30
+ if (container != null) {
31
+ container._leaflet_id = null;
32
+ }
33
+
29
34
  this.map = L.map(mapId, options || {});
30
35
 
31
36
  L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osimatic/helpers-js",
3
- "version": "1.1.73",
3
+ "version": "1.1.75",
4
4
  "main": "main.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"