Make icons in legend OptIn
Make them OptIn Add option to docs
This commit is contained in:
@@ -215,6 +215,9 @@ The following keys are accepted in the marker dictionary:
|
|||||||
``createInfoWindow``
|
``createInfoWindow``
|
||||||
Optional. Specifies whether or not the icon displays an info window on click. Defaults to True
|
Optional. Specifies whether or not the icon displays an info window on click. Defaults to True
|
||||||
|
|
||||||
|
``showIconInLegend``
|
||||||
|
Optional. Specifies whether or not the icon is displayed in the legend. Defaults to False
|
||||||
|
|
||||||
``checked``
|
``checked``
|
||||||
Optional. Specifies whether or not this marker group will be checked(visible) by default when
|
Optional. Specifies whether or not this marker group will be checked(visible) by default when
|
||||||
the map loads. Defaults to False
|
the map loads. Defaults to False
|
||||||
|
|||||||
@@ -568,7 +568,8 @@ def main():
|
|||||||
displayName=f['name'],
|
displayName=f['name'],
|
||||||
icon=f.get('icon', 'signpost_icon.png'),
|
icon=f.get('icon', 'signpost_icon.png'),
|
||||||
createInfoWindow=f.get('createInfoWindow', True),
|
createInfoWindow=f.get('createInfoWindow', True),
|
||||||
checked=f.get('checked', False))
|
checked=f.get('checked', False),
|
||||||
|
showIconInLegend=f.get('showIconInLegend', False))
|
||||||
marker_groups[rname].append(group)
|
marker_groups[rname].append(group)
|
||||||
|
|
||||||
# initialize the structure for the markers
|
# initialize the structure for the markers
|
||||||
|
|||||||
@@ -424,8 +424,14 @@ overviewer.util = {
|
|||||||
marker_group.addLayer(layerObj);
|
marker_group.addLayer(layerObj);
|
||||||
}
|
}
|
||||||
// Save marker group
|
// Save marker group
|
||||||
var layer_name_html = marker_entry.displayName +
|
var layer_name_html;
|
||||||
|
if (marker_entry.showIconInLegend) {
|
||||||
|
layer_name_html = marker_entry.displayName +
|
||||||
'<img class="ov-marker-legend" src="' + marker_entry.icon + '"></img>';
|
'<img class="ov-marker-legend" src="' + marker_entry.icon + '"></img>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
layer_name_html = marker_entry.displayName;
|
||||||
|
}
|
||||||
obj.marker_groups[layer_name_html] = marker_group;
|
obj.marker_groups[layer_name_html] = marker_group;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user