Moderators: Unholy, bextein, Glodenox, JustinS83
seb-d59 wrote:Update v1.7:
- Support for all subcategories "Natural Features" (Island, Sea/Lake/Pool, River/Stream, Forest/Grove, Farm, Canal, Swamp / Marsh, Dam)
--- /tmp/splitpoi.orig 2018-01-03 15:01:14.075473900 -0500
+++ /tmp/splitpoi 2018-01-03 15:11:11.577573400 -0500
@@ -235,7 +235,7 @@
if (!attributes.geometry.hasOwnProperty("components"))
return;
- if (!((attributes.categories == "NATURAL_FEATURES" ) || (attributes.categories == "ISLAND" ) || (attributes.categories == "SEA_LAKE_POOL") || (attributes.categories == "RIVER_STREAM" ) || (attributes.categories == "FOREST_GROVE") || (attributes.categories == "FARM" ) || (attributes.categories == "CANAL" ) || (attributes.categories == "SWAMP_MARSH" ) || (attributes.categories == "DAM" )))
+ if (!((attributes.categories == "NATURAL_FEATURES" ) || (attributes.categories == "ISLAND" ) || (attributes.categories == "SEA_LAKE_POOL") || (attributes.categories == "RIVER_STREAM" ) || (attributes.categories == "FOREST_GROVE") || (attributes.categories == "FARM" ) || (attributes.categories == "CANAL" ) || (attributes.categories == "SWAMP_MARSH" ) || (attributes.categories == "DAM" ) || (attributes.categories == "PARKING_LOT" )))
return;
log("selectionManager",selectionManager);
@@ -254,14 +254,14 @@
item=getId("landmark-edit-general");
var attSection = getElementsByClassName("attributes-form side-panel-section", item);
- var btnResidential = getElementsByClassName("btn-link toggle-residential",item);
- var parent1 = btnResidential[0].parentNode;
+ var extProviders = getElementsByClassName("external-providers-view");
+ var parent1 = extProviders[0].parentNode;
var parent = parent1.parentNode;
var WMESP_Controle=document.createElement('Div');
WMESP_Controle.id="WMESP-Controle";
- WMESP_Controle.innerHTML+='<br><input type="button" id="_btnSplitPOI" class="action-button waze-btn waze-btn-white" value="Split POI"><br>';
- attSection[0].insertBefore(WMESP_Controle, parent);
+ WMESP_Controle.innerHTML+='<br><input type="button" id="_btnSplitPOI" class="action-button waze-btn waze-btn-white" value="Split POI"><br><br>';
+ attSection[0].insertBefore(WMESP_Controle, parent.nextSibling); // nextSibling makes this effectively an "insertAfter"
getId("_btnSplitPOI").onclick=SplitPOI;
}
@@ -425,6 +425,7 @@
clonePoiAttr.aliases = poi.attributes.aliases;
clonePoiAttr.approved = poi.attributes.approved;
clonePoiAttr.categories = poi.attributes.categories;
+ clonePoiAttr.categoryAttributes = poi.attributes.categoryAttributes;
clonePoiAttr.description = poi.attributes.description;
clonePoiAttr.externalProviderIDs = poi.attributes.externalProviderIDs;
clonePoiAttr.houseNumber = poi.attributes.houseNumber;
@@ -446,33 +447,18 @@
// copie du nom et mise à jour du nouveau poi
var street = wazeModel.streets.objects[poi.attributes.streetID];
- streetName = street.name;
+ var streetName = street.name;
+ var streetEmpty = street.isEmpty
var cityID = street.cityID;
var city = wazeModel.cities.objects[cityID];
+ var cityEmpty = city.attributes.isEmpty
var stateID = wazeModel.cities.objects[cityID].attributes.stateID;
var state = wazeModel.states.objects[stateID];
var countryID = wazeModel.cities.objects[cityID].attributes.countryID;
var country = wazeModel.countries.objects[countryID];
-
- if (!street.isEmpty || !city.attributes.isEmpty){ // nok
- var newAtts = { emptyStreet: true, stateID: stateID, countryID: countryID, cityName: city.attributes.name, streetName: streetName, emptyCity: true };
- log ('Natural feature POI: no street name and city');
- wazeModel.actionManager.add(new WazeActionUpdateFeatureAddress(poi, newAtts));
- }
- var street = wazeModel.streets.objects[clonePoi.attributes.streetID];
- streetName = street.name;
- var cityID = street.cityID;
- var city = wazeModel.cities.objects[cityID];
- var stateID = wazeModel.cities.objects[cityID].attributes.stateID;
- var state = wazeModel.states.objects[stateID];
- var countryID = wazeModel.cities.objects[cityID].attributes.countryID;
- var country = wazeModel.countries.objects[countryID];
-
- if (!street.isEmpty || !city.attributes.isEmpty){ // nok
- var newAtts = { emptyStreet: true, stateID: stateID, countryID: countryID, cityName: city.attributes.name, streetName: streetName, emptyCity: true };
- log ('Natural feature POI: no street name and city');
- wazeModel.actionManager.add(new WazeActionUpdateFeatureAddress(clonePoi, newAtts));
- }
+
+ var newAtts = { emptyStreet: streetEmpty, stateID: stateID, countryID: countryID, cityName: city.attributes.name, streetName: streetName, emptyCity: cityEmpty };
+ wazeModel.actionManager.add(new WazeActionUpdateFeatureAddress(clonePoi, newAtts));
//log('wazeModel.actionManager = ',wazeModel.actionManager);
MaximKiev wrote:Hello,
Thank you for the script. Unfortunately the button doesn't appear in POI. Mac, Chrome, Tampermonkey, category: Sea/Lake/Pool.
Return to Addons, Extensions, and Scripts
Users browsing this forum: Google Feedfetcher, jm6087, Mapman44, Mythdraug, The_Cre8r