BRYAN
Have a look at this demo I put together showing how to build a sidebar and search functionality using Leaflet with GeoJSON: http://projects.bryanmcbride.com/leaflet/geojson_hacks.html
BRYAN
--
--
---
You received this message because you are subscribed to a topic in the Google Groups "Leaflet" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leaflet-js/4cRQTLPjqvo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leaflet-js+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
console.log(hikes);
var features = [];
hikes.eachLayer(function (layer) {
var id = layer._leaflet_id;
var date = layer.feature.properties.Date;
var coords = layer.feature.geometry.coordinates;
// Populate features array and build autocomplete
features.push({id: id, label: date, value: date, lat: lat, lng: lng});
console.log(features);
// Populate sidebar table with clickable feature links
$(".list-group ul").append('<li><a href="#" onclick="map._layers['+id+'].openPopup(); return false;">'+date+'</a></li>');
// Add features to zoom dropdown
});
<div class="list-group" id="listings">
<ul><li>ha2</li></ul>
<div id="list-group-container">
<button class="list-group-item">title
<p class="address">address</p>
<li>test</li>
</button>
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "01",
"properties": {
"Date": "Nov 1",
"Location": "Oaxaca Panteon",
"Terrain": "City",
"Difficulty": "Easy"
},
"geometry": {
"type": "Point",
"coordinates": [
-96.7587967,
17.1174164
]
}
},
{
"type": "Feature",
"id": "02",
"properties": {
"Date": "3/4/2014",
"Location": "Apoala",
"Terrain": "Countryside",
"Difficulty": "Difficult"
},
"geometry": {
"type": "Point",
"coordinates": [
-97.1377792,
17.6514606
]
}
},
--
---
You received this message because you are subscribed to a topic in the Google Groups "Leaflet" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leaflet-js/4cRQTLPjqvo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leaflet-js+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Still no dice. Thanks though.
--