Skip to content

Commit e36a029

Browse files
committed
Various CSS cleanup and fixes, many for touch. Fixes #7.
1 parent 34a679f commit e36a029

File tree

2 files changed

+52
-12
lines changed

2 files changed

+52
-12
lines changed

Control.Geocoder.css

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
border-radius: 4px;
66
}
77

8-
.leaflet-touch .leaflet-bar {
8+
.leaflet-touch .leaflet-control-geocoder {
9+
box-shadow: none;
10+
border: 4px solid rgba(0,0,0,0.2);
11+
background-clip: padding-box;
912
-webkit-border-radius: 10px;
1013
border-radius: 10px;
1114
}
@@ -15,14 +18,6 @@
1518
}
1619

1720
.leaflet-control-geocoder-form input, .leaflet-control-geocoder-form ul, .leaflet-control-geocoder-error {
18-
/* float: right;
19-
clear: both;
20-
box-shadow: 0 1px 7px rgba(0,0,0,0.4);
21-
background: #f8f8f9;
22-
-webkit-border-radius: 5px;
23-
border-radius: 5px;
24-
border: 0;
25-
color: transparent;*/
2621
border: 0;
2722
color: transparent;
2823
background: white;
@@ -34,23 +29,29 @@
3429
transition: width 0.125s ease-in;
3530
}
3631

32+
.leaflet-touch .leaflet-control-geocoder-form input {
33+
font-size: 22px;
34+
}
35+
3736
.leaflet-control-geocoder-icon {
3837
width: 26px;
3938
height: 26px;
4039
background-image: url(images/geocoder.png);
4140
background-repeat: no-repeat;
4241
background-position: right;
4342
float: right;
43+
cursor: pointer;
4444
}
4545

4646
.leaflet-control-geocoder-throbber .leaflet-control-geocoder-icon {
4747
background-image: url(images/throbber.gif);
4848
}
4949

5050
.leaflet-control-geocoder-expanded input, .leaflet-control-geocoder-error {
51-
width: 200px;
52-
padding-left: 8px;
53-
padding-right: 26px;
51+
width: 226px;
52+
margin-left: 4px;
53+
padding-left: 4px;
54+
padding-right: 0px;
5455
color: #000;
5556
}
5657

@@ -98,6 +99,7 @@ ul.leaflet-control-geocoder-alternatives {
9899
padding: 0;
99100
}
100101

102+
101103
.leaflet-control-geocoder-alternatives li:last-child {
102104
border-bottom: none;
103105
}
@@ -110,6 +112,10 @@ ul.leaflet-control-geocoder-alternatives {
110112
font-size: 14px;
111113
}
112114

115+
.leaflet-touch .leaflet-control-geocoder-alternatives a {
116+
font-size: 18px;
117+
}
118+
113119
.leaflet-control-geocoder-alternatives a:hover, .leaflet-control-geocoder-selected {
114120
background-color: #ddd;
115121
}

test/touch.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Leaflet Control Geocoder</title>
5+
6+
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
7+
<!--[if lte IE 8]><link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" /><![endif]-->
8+
<link rel="stylesheet" href="../Control.Geocoder.css" />
9+
10+
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet-src.js"></script>
11+
<script src="../Control.Geocoder.js"></script>
12+
<style type="text/css">
13+
body {
14+
margin: 0;
15+
}
16+
#map {
17+
position: absolute;
18+
width: 100%;
19+
height: 100%;
20+
}
21+
</style>
22+
</head>
23+
<body>
24+
<div id="map" class="leaflet-touch"></div>
25+
26+
<script type="text/javascript">
27+
var map = L.map('map').setView([0, 0], 2);
28+
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
29+
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
30+
}).addTo(map);
31+
L.Control.geocoder().addTo(map);
32+
</script>
33+
</body>
34+
</html>

0 commit comments

Comments
 (0)