Hi there,
Another rookie question.
So Im trying to get my map to automatically zoom to some filtered features from an arcgis web service, I gather the best way to do this to get the bounds of a feature group of which my WFS should belong. I'm having some trouble however getting this to work
This is what I've got at the moment
<script>
var map = L.map('map').setView([45.52751668442124, -122.67175197601318], 13);
L.tileLayer('http://{s}.
tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data © <a href="
http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="
http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="
http://cloudmade.com">CloudMade</a>'
}).addTo(map);
myAGSLayer = new lvector.AGS({
url: "
http://services.arcgis.com/rOo16HdIMeOBI4Mb/arcgis/rest/services/Parks_pdx/FeatureServer/0",
fields: "PROPERTYID,NAME,ACRES",
uniqueField: "OBJECTID",
where: "PROPERTYID = '1128'",
scaleRange: [5, 20],
popupTemplate: 'Property ID: {PROPERTYID}</br>Acres: {ACRES}'
}).setMap(map);
var lmdb = new L.featureGroup([myAGSLayer]);
map.fitBounds(lmdb.getBounds());
</script>
I've managed to get the getBounds working on another example but no luck with this one.
Any tips?
Thanks,
Rowan