From 85ba67327e0bd16cde6a4e3861234b96e7d5cfc6 Mon Sep 17 00:00:00 2001 From: Carlos Angel Gomez Honig Date: Wed, 22 May 2019 14:31:56 -0400 Subject: [PATCH 1/3] adding option to show house number next to place name --- WMEPIE.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/WMEPIE.js b/WMEPIE.js index 0645c42..a29f059 100644 --- a/WMEPIE.js +++ b/WMEPIE.js @@ -173,6 +173,7 @@ var UpdateObject, MultiAction; '
', '
', '
', + '
', `
`, '
', I18n.t('pie.prefs.FontSize') + ' px
', @@ -316,6 +317,7 @@ var UpdateObject, MultiAction; $('#_cbShowPlaceNamesArea')[0].disabled = false; $('#_cbShowPlaceNamesPLA')[0].disabled = false; $('#_cbShowPlaceNamesLock')[0].disabled = false; + $('#_cbShowPlaceNamesHN')[0].disabled = false; $('#_cbhidePlaceNamesWhenPlacesHidden')[0].disabled = false; } else @@ -324,6 +326,7 @@ var UpdateObject, MultiAction; $('#_cbShowPlaceNamesArea')[0].disabled = true; $('#_cbShowPlaceNamesPLA')[0].disabled = true; $('#_cbShowPlaceNamesLock')[0].disabled = true; + $('#_cbShowPlaceNamesHN')[0].disabled = true; $('#_cbhidePlaceNamesWhenPlacesHidden')[0].disabled = true; } console.log(this.checked); @@ -496,6 +499,7 @@ var UpdateObject, MultiAction; setChecked('_cbShowPlaceNamesArea', settings.ShowPlaceNamesArea); setChecked('_cbShowPlaceNamesPLA', settings.ShowPlaceNamesPLA); setChecked('_cbShowPlaceNamesLock', settings.ShowPlaceNamesLock); + setChecked('_cbShowPlaceNamesHN', settings.ShowPlaceNamesHN); setChecked('_cbClearDescription', settings.ClearDescription); setChecked('_cbPlaceNameFontBold', settings.PlaceNameFontBold); setChecked('_cbPlaceLocatorCrosshairProdPL', settings.PlaceLocatorCrosshairProdPL); @@ -517,6 +521,7 @@ var UpdateObject, MultiAction; $('#_cbShowPlaceNamesArea')[0].disabled = false; $('#_cbShowPlaceNamesPLA')[0].disabled = false; $('#_cbShowPlaceNamesLock')[0].disabled = false; + $('#_cbShowPlaceNamesHN')[0].disabled = false; $('#_cbhidePlaceNamesWhenPlacesHidden')[0].disabled = false; } $('#piePlaceZoom')[0].value = settings.PlaceZoom; @@ -1820,11 +1825,12 @@ var UpdateObject, MultiAction; function DisplayPlaceNames(){ PIEPlaceNameLayer.removeAllFeatures(); - var showPoint, showArea, showLock, showNames, showPLA, hideNames; + var showPoint, showArea, showLock, showNames, showPLA, hideNames, showHN; showNames = isChecked('_cbShowPlaceNames'); showPoint = isChecked('_cbShowPlaceNamesPoint'); showArea = isChecked('_cbShowPlaceNamesArea'); showLock = isChecked('_cbShowPlaceNamesLock'); + showHN = isChecked('_cbShowPlaceNamesHN'); showPLA = isChecked('_cbShowPlaceNamesPLA'); hideNames = isChecked('_cbhidePlaceNamesWhenPlacesHidden'); @@ -1844,7 +1850,7 @@ var UpdateObject, MultiAction; textLoc = new OL.Geometry.Point(venue.geometry.x, venue.geometry.y); else textLoc = venue.geometry.getCentroid(); - let placeName =WordWrap(venue.attributes.name.trim() + (showLock ? ' (L' + (venue.attributes.lockRank + 1) + ')' : '')); + let placeName =WordWrap(venue.attributes.name.trim() + (showLock ? ' (L' + (venue.attributes.lockRank + 1) + ')' : '') + (showHN && venue.attributes.houseNumber ? ' <' + (venue.attributes.houseNumber) + '>' : '')); if(venue.attributes.categories[0] === "RESIDENCE_HOME") placeName = venue.attributes.houseNumber + (venue.attributes.name.trim() !== '' ? ' - ' + venue.attributes.name : '') + (showLock ? ' (L' + (venue.attributes.lockRank + 1) + ')' : ''); let placeNameLabel = new OL.Feature.Vector(textLoc,{display: 'block',labelText: placeName.trim(), yOffset:(isPoint ? -13 - placeName.split("\n").length * 5 : 0)}); @@ -3736,6 +3742,8 @@ var UpdateObject, MultiAction; ShowAreaNamesTitle: "Will display the Place's name in the middle of the Place area", ShowLockLevel: 'Show lock level', ShowLockLevelTitle: "Will display the Place's lock level in the middle of the Place area", + ShowPlaceHouseNumber: "Show house number", + ShowPlaceHouseNumberTitle: "Will display the Place's house number in the middle of the Place area", ShowPLAName: 'Show PLA name', ShowPLANameTitle: '', Item: 'Item', @@ -3858,6 +3866,8 @@ var UpdateObject, MultiAction; ShowAreaNamesTitle: "Muestra el nombre de lugares definidos como área", ShowLockLevel: 'Mostrar nivel de bloqueo', ShowLockLevelTitle: "Muestra el nivel de bloqueo en el centro del lugar", + ShowPlaceHouseNumber: "Mostrar numero de casa", + ShowPlaceHouseNumberTitle: "Muestra el numero de casa en el centro del lugar", ShowPLAName: 'Mostrar nombre de PLA', ShowPLANameTitle: 'Muestra el nombre de áreas de estacionamiento (PLAs)', Item: 'Opción', From 79813e543351791505f50bba72cc96e457180248 Mon Sep 17 00:00:00 2001 From: Carlos Angel Gomez Honig Date: Wed, 22 May 2019 15:54:50 -0400 Subject: [PATCH 2/3] setting was not being saved --- WMEPIE.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WMEPIE.js b/WMEPIE.js index a29f059..ffb2639 100644 --- a/WMEPIE.js +++ b/WMEPIE.js @@ -3539,6 +3539,7 @@ var UpdateObject, MultiAction; ShowPlaceNamesPoint: false, ShowPlaceNamesArea: false, ShowPlaceNamesLock: false, + ShowPlaceNamesHN: false, ShowCopyPlaceButton: false, ShowExternalProviderTooltip: false, ShowPlaceNamesPLA: false, @@ -3624,6 +3625,7 @@ var UpdateObject, MultiAction; ShowPlaceNamesPoint: settings.ShowPlaceNamesPoint, ShowPlaceNamesArea: settings.ShowPlaceNamesArea, ShowPlaceNamesLock: settings.ShowPlaceNamesLock, + ShowPlaceNamesHN: settings.ShowPlaceNamesHN, ShowCopyPlaceButton: settings.ShowCopyPlaceButton, ShowExternalProviderTooltip: settings.ShowExternalProviderTooltip, ShowPlaceNamesPLA: settings.ShowPlaceNamesPLA, From 8cc35a5eff51989593a9e50d29d19f0046e4d759 Mon Sep 17 00:00:00 2001 From: Carlos Angel Gomez Honig Date: Wed, 12 Jun 2019 11:57:35 -0400 Subject: [PATCH 3/3] adding venue name next to house number --- WMEPIE.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WMEPIE.js b/WMEPIE.js index bca35fc..48c30d0 100644 --- a/WMEPIE.js +++ b/WMEPIE.js @@ -1863,7 +1863,12 @@ var UpdateObject, MultiAction; textLoc = new OL.Geometry.Point(venue.geometry.x, venue.geometry.y); else textLoc = venue.geometry.getCentroid(); - let placeName =WordWrap(venue.attributes.name.trim() + (showLock ? ' (L' + (venue.attributes.lockRank + 1) + ')' : '') + (showHN && venue.attributes.houseNumber ? ' <' + (venue.attributes.houseNumber) + '>' : '')); + let placeName = venue.attributes.name.trim() + (showLock ? ' (L' + (venue.attributes.lockRank + 1) + ')' : ''); + if (showHN && venue.attributes.houseNumber){ + placeName += '\n' + venue.getAddress().attributes.street.name; + placeName += ' <' + (venue.attributes.houseNumber) + '>'; + } + placeName = WordWrap(placeName); if(venue.attributes.categories[0] === "RESIDENCE_HOME") placeName = venue.attributes.houseNumber + (venue.attributes.name.trim() !== '' ? ' - ' + venue.attributes.name : '') + (showLock ? ' (L' + (venue.attributes.lockRank + 1) + ')' : ''); let placeNameLabel = new OL.Feature.Vector(textLoc,{display: 'block',labelText: placeName.trim(), yOffset:(isPoint ? -13 - placeName.split("\n").length * 5 : 0)});