LVL seems to handle popups differently than Leaflet. With a typical Leaflet GeoJSON layer, you can open a popup based on a property like so:
geojson.eachLayer(function (layer) {
var id = layer._leaflet_id;
if (name === 'California') {
map._layers[id].openPopup();
}
});
I've tried iterating over an LVL layer to get the properties and Leaflet ID, but I'm stuck as far as triggering the popup. It looks like there is a _showPopup function, but I'm not quite sure how to wire it all up properly. Here's what I've got so far (using the map1 example on
http://geojason.info/leaflet-vector-layers/demos/cartodb/):
for (each in cartodb_man_hole._vectors) {
//console.log(cartodb_man_hole._vectors[each]);
//console.log(cartodb_man_hole._vectors[each].vector._leaflet_id);
if (cartodb_man_hole._vectors[each].properties.cartodb_id == 2921) {
var layer = cartodb_man_hole._vectors[each];
cartodb_man_hole._showPopup(layer);
}
}
Any help you could provide would be most appreciated!
BRYAN