Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding option to show house number next to place name #3

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions WMEPIE.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ var UpdateObject, MultiAction;
'<div id="divShowNamesArea"class="controls-container pie-controls-container" style="padding-left:20px;" title="' + I18n.t('pie.prefs.ShowAreaNamesTitle') + '"><input type="checkbox" id="_cbShowPlaceNamesArea" class="pieSettingsCheckbox" disabled /><label for ="_cbShowPlaceNamesArea">' + I18n.t('pie.prefs.ShowAreaNames') + '</label></div>',
'<br><div id="divShowNamesPLA"class="controls-container pie-controls-container" style="padding-left:20px;" title="' + I18n.t('pie.prefs.ShowPLANameTitle') + '"><input type="checkbox" id="_cbShowPlaceNamesPLA" class="pieSettingsCheckbox" disabled /><label for ="_cbShowPlaceNamesPLA">' + I18n.t('pie.prefs.ShowPLAName') + '</label></div>',
'<br><div id="divShowNamesLock"class="controls-container pie-controls-container" style="padding-left:20px;" title="' + I18n.t('pie.prefs.ShowLockLevelTitle') + '"><input type="checkbox" id="_cbShowPlaceNamesLock" class="pieSettingsCheckbox" disabled /><label for ="_cbShowPlaceNamesLock">' + I18n.t('pie.prefs.ShowLockLevel') + '</label></div>',
'<br><div id="divShowNamesHN"class="controls-container pie-controls-container" style="padding-left:20px;" title="' + I18n.t('pie.prefs.ShowPlaceHouseNumberTitle') + '"><input type="checkbox" id="_cbShowPlaceNamesHN" class="pieSettingsCheckbox" disabled /><label for ="_cbShowPlaceNamesHN">' + I18n.t('pie.prefs.ShowPlaceHouseNumber') + '</label></div>',
`<br><div id="divhidePlaceNamesWhenPlacesHidden" class="controls-container pie-controls-container" style="padding-left:20px;" title="${I18n.t('pie.prefs.hidePlaceNamesWhenPlacesHiddenTitle')}"><input type="checkbox" id="_cbhidePlaceNamesWhenPlacesHidden" class="pieSettingsCheckbox" disabled /><label for="_cbhidePlaceNamesWhenPlacesHidden">${I18n.t('pie.prefs.hidePlaceNamesWhenPlacesHidden')}</label></div>`,
'<div id="divPlaceNamesFontCustomization" class="controls-container pie-controls-container" style="padding-left:20px;">',
I18n.t('pie.prefs.FontSize') + ' <input type="text" size="1" id="piePlaceNameFontSize"/>px</br>',
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -1834,11 +1839,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');

Expand All @@ -1858,7 +1864,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) + ')' : ''));
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)});
Expand Down Expand Up @@ -3547,6 +3558,7 @@ var UpdateObject, MultiAction;
ShowPlaceNamesPoint: false,
ShowPlaceNamesArea: false,
ShowPlaceNamesLock: false,
ShowPlaceNamesHN: false,
ShowCopyPlaceButton: false,
ShowExternalProviderTooltip: false,
ShowPlaceNamesPLA: false,
Expand Down Expand Up @@ -3638,6 +3650,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,
Expand Down Expand Up @@ -3787,6 +3800,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',
Expand Down Expand Up @@ -3909,6 +3924,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',
Expand Down