我期待模仿此功能:http://jsbin.com/cirafujinu/edit?html,output上的展開和圖標顯示文本框,單擊
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Geocoding Map</title>
<meta charset="utf-8">
<link rel="stylesheet" href="https://mapzen.com/js/mapzen.css">
<script src="https://mapzen.com/js/mapzen.min.js"></script>
<style>
#map {
height: 100%;
width: 100%;
position: absolute;
}
html,body{margin: 0; padding: 0}
</style>
</head>
<body>
<div id='map'></div>
<script>
// Set the global API key
L.Mapzen.apiKey = "your-mapzen-api-key";
// Add a map to the #map div
// Center on the Pigott building at Seattle University
var map = L.Mapzen.map("map", {
center: [47.61033,-122.31801],
zoom: 16,
});
// Disable autocomplete and set parameters for the search query
var geocoderOptions = {
autocomplete: false,
params: {
sources: 'osm',
'boundary.country': 'USA',
layers: 'address,venue'
}
};
// Add the geocoder to the map, set parameters for geocoder options
var geocoder = L.Mapzen.geocoder(geocoderOptions);
geocoder.addTo(map);
</script>
</body>
</html>
我試圖來解構的JavaScript中使用比可能更多的功能做到這一點,但其一個500+線複雜的對象我需要。
我有權訪問jQuery和jQuery UI。我應該從什麼方式開始?
我知道它有一個焦點事件,如果你關注文本框,它會回到最小化狀態。
我打開演示/想法人們已經看到非常相似的功能,所以我可以用它作爲參考。
您可以使用CSS轉換並在點擊時切換類。 – doutriforce