Browse Source

UI: Control maps labels color.

pull/81/head
Igor Kulikov 10 years ago
parent
commit
795d54b74e
  1. 2
      ui/src/app/widget/lib/google-map.js
  2. 1
      ui/src/app/widget/lib/map-widget.js
  3. 4
      ui/src/app/widget/lib/openstreet-map.js

2
ui/src/app/widget/lib/google-map.js

@ -200,7 +200,7 @@ export default class TbGoogleMap {
map: this.map, map: this.map,
icon: pinImage, icon: pinImage,
shadow: pinShadow, shadow: pinShadow,
labelContent: '<b>'+settings.label+'</b>', labelContent: '<div style="color: '+ settings.labelColor +';"><b>'+settings.label+'</b></div>',
labelClass: "tb-labels", labelClass: "tb-labels",
labelAnchor: new google.maps.Point(50, height + 20) labelAnchor: new google.maps.Point(50, height + 20)
}); });

1
ui/src/app/widget/lib/map-widget.js

@ -99,6 +99,7 @@ export default class TbMapWidget {
lngKeyName: "lng", lngKeyName: "lng",
showLabel: true, showLabel: true,
label: "", label: "",
labelColor: ctx.widgetConfig.color || '#000000',
color: "#FE7569", color: "#FE7569",
useColorFunction: false, useColorFunction: false,
colorFunction: null, colorFunction: null,

4
ui/src/app/widget/lib/openstreet-map.js

@ -78,7 +78,7 @@ export default class TbOpenStreetMap {
marker.setIcon(icon); marker.setIcon(icon);
if (settings.showLabel) { if (settings.showLabel) {
marker.unbindTooltip(); marker.unbindTooltip();
marker.bindTooltip('<b>' + settings.label + '</b>', marker.bindTooltip('<div style="color: '+ settings.labelColor +';"><b>'+settings.label+'</b></div>',
{ className: 'tb-marker-label', permanent: true, direction: 'top', offset: [0, -height + 10] }); { className: 'tb-marker-label', permanent: true, direction: 'top', offset: [0, -height + 10] });
} }
} }
@ -101,7 +101,7 @@ export default class TbOpenStreetMap {
var marker = L.marker(location, {icon: icon}).addTo(this.map); var marker = L.marker(location, {icon: icon}).addTo(this.map);
if (settings.showLabel) { if (settings.showLabel) {
marker.bindTooltip('<b>' + settings.label + '</b>', marker.bindTooltip('<div style="color: '+ settings.labelColor +';"><b>'+settings.label+'</b></div>',
{ className: 'tb-marker-label', permanent: true, direction: 'top', offset: [0, -height + 10] }); { className: 'tb-marker-label', permanent: true, direction: 'top', offset: [0, -height + 10] });
} }

Loading…
Cancel
Save