Skip to content

Commit

Permalink
Rename Label in Tooltip, PopupBase in DivOverlay
Browse files Browse the repository at this point in the history
  • Loading branch information
yohanboniface committed Jul 8, 2016
1 parent a1e43ed commit 64ba1f7
Show file tree
Hide file tree
Showing 19 changed files with 556 additions and 556 deletions.
12 changes: 6 additions & 6 deletions build/deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var deps = {

Popup: {
src: [
'layer/PopupBase.js',
'layer/DivOverlay.js',
'layer/Popup.js',
'layer/Layer.Popup.js',
'layer/marker/Marker.Popup.js'
Expand All @@ -78,14 +78,14 @@ var deps = {
desc: 'Used to display the map popup (used mostly for binding HTML data to markers and paths on click).'
},

Label: {
Tooltip: {
src: [
'layer/Label.js',
'layer/Layer.Label.js',
'layer/marker/Marker.Label.js'
'layer/Tooltip.js',
'layer/Layer.Tooltip.js',
'layer/marker/Marker.Tooltip.js'
],
deps: ['Popup', 'Marker'],
desc: 'Used to display the map label (used mostly for binding short descriptions to markers and paths on mouseover).'
desc: 'Used to display the map tooltip (used mostly for binding short descriptions to markers and paths on mouseover).'
},

LayerGroup: {
Expand Down
2 changes: 1 addition & 1 deletion build/docs-index.leafdoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This file just defines the order of the classes in the docs.

@class Marker
@class Popup
@class Label
@class Tooltip

@class TileLayer
@class TileLayer.WMS
Expand Down
2 changes: 1 addition & 1 deletion build/leafdoc-templates/html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<ul>
<li><a href="#marker">Marker</a></li>
<li><a href="#popup">Popup</a></li>
<li><a href="#label">Label</a></li>
<li><a href="#tooltip">Tooltip</a></li>
</ul>
<h4>Raster Layers</h4>
<ul>
Expand Down
69 changes: 0 additions & 69 deletions debug/map/label.html

This file was deleted.

69 changes: 69 additions & 0 deletions debug/map/tooltip.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!DOCTYPE html>
<html>
<head>
<title>Leaflet debug page</title>

<link rel="stylesheet" href="../../dist/leaflet.css" />

<link rel="stylesheet" href="../css/screen.css" />

<script type="text/javascript" src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
<style type="text/css">
.my-div-icon {
background-color: goldenrod;
text-align: center;
}
#map {
width: 100%;
}

</style>
</head>
<body>

<div id="map"></div>


<script type="text/javascript">
var center = [41.2058, 9.4307];

var map = L.map('map').setView(center, 13);

L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

L.polygon([[41.21, 9.42], [41.22, 9.40], [41.23, 9.40]]).addTo(map).bindTooltip('Default centered polygon tooltip');
L.polygon([[41.20, 9.41], [41.20, 9.39], [41.21, 9.40]]).addTo(map).bindTooltip('Polygon tooltip following mouse', {sticky: true});
L.polygon([[41.18, 9.42], [41.17, 9.40], [41.19, 9.38]]).addTo(map).bindTooltip('Permanent polygon tooltip', {permanent: true});
L.marker([41.20, 9.4307]).addTo(map).bindTooltip('tooltip on the left', {direction: 'left'});
L.marker([41.206, 9.44]).addTo(map).bindTooltip('click me, I have a popup', {permanent: true, interactive: true}).bindPopup('See?');
L.circleMarker([41.206, 9.48], {color: 'Chocolate', radius: 12}).addTo(map).bindTooltip('Hello Left World', {direction: 'left'});
L.circleMarker([41.20, 9.50], {color: 'Chocolate', radius: 12}).addTo(map).bindTooltip('Hello top World', {direction: 'top', permanent: true});
L.circleMarker([41.20, 9.47], {color: 'Tomato', radius: 10}).addTo(map).bindTooltip('Seems I am centered', {direction: 'center', permanent: true, interactive: true}).bindPopup('Yeah');
L.circleMarker([41.195, 9.47], {color: 'Tomato', radius: 10}).addTo(map).bindTooltip('Me too', {direction: 'center'}).bindPopup('Yeah');
var icon = L.divIcon({
className: 'my-div-icon',
html: '<p>A div icon</p>',
iconSize: [50, 50]
});
L.marker([41.22, 9.48], {icon: icon}).addTo(map).bindTooltip('A div icon tooltip following mouse', {sticky: true, direction: 'auto'});
L.marker([41.23, 9.47], {icon: icon}).addTo(map).bindTooltip('A div icon tooltip');
L.marker([41.23, 9.42], {draggable: true}).addTo(map).bindTooltip('Draggable marker tooltip', {permanent: true, direction: 'auto'});
L.marker([41.19, 9.43]).addTo(map).bindTooltip('Clickable marker tooltip', {permanent: true, interactive: true}).on('click', function () { alert('clicked!'); });

var marker1 = L.marker([41.18, 9.45], {description: 'Marker 1'});
var marker2 = L.marker([41.18, 9.46], {description: 'Marker 2'});
var group = new L.FeatureGroup([marker1, marker2]).addTo(map);
group.bindTooltip(function (layer) {
return 'Group tooltip: ' + layer.options.description;
}, {opacity: 0.7});
L.marker([41.18, 9.35]).addTo(map).bindTooltip('Top tooltip is top', {permanent: true, direction: 'top'});
L.marker([41.173, 9.37]).addTo(map).bindTooltip('Bottom tooltip is weird but ok', {permanent: true, direction: 'bottom'});
L.polyline([[41.20, 9.36], [41.205, 9.35], [41.19, 9.34]]).addTo(map).bindTooltip('Polyline tooltip', {permanent: true, direction: 'top'});
L.polygon([[41.21, 9.36], [41.24, 9.35], [41.23, 9.34]]).addTo(map).bindTooltip('Top tooltip following mouse', {sticky: true, direction: 'top'});

</script>
</body>
</html>
32 changes: 16 additions & 16 deletions dist/leaflet.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-label-pane { z-index: 650; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }

.leaflet-map-pane canvas { z-index: 100; }
Expand Down Expand Up @@ -539,9 +539,9 @@
}


/* Label */
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-label {
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
Expand All @@ -555,14 +555,14 @@
user-select: none;
pointer-events: none;
}
.leaflet-label.leaflet-clickable {
.leaflet-tooltip.leaflet-clickable {
cursor: pointer;
pointer-events: auto;
}
.leaflet-label-top:before,
.leaflet-label-bottom:before,
.leaflet-label-left:before,
.leaflet-label-right:before {
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
Expand All @@ -572,33 +572,33 @@

/* Directions */

.leaflet-label-bottom:before,
.leaflet-label-top:before {
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-label-top:before {
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-label-bottom:before {
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-label-left:before,
.leaflet-label-right:before {
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-label-left:before {
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-label-right:before {
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
Expand Down
2 changes: 1 addition & 1 deletion spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<script type="text/javascript" src="suites/layer/ImageOverlaySpec.js"></script>
<script type="text/javascript" src="suites/layer/LayerGroupSpec.js"></script>
<script type="text/javascript" src="suites/layer/PopupSpec.js"></script>
<script type="text/javascript" src="suites/layer/LabelSpec.js"></script>
<script type="text/javascript" src="suites/layer/TooltipSpec.js"></script>

<!-- /layer/tile -->
<script type="text/javascript" src="suites/layer/tile/GridLayerSpec.js"></script>
Expand Down
Loading

0 comments on commit 64ba1f7

Please sign in to comment.