Skip to content

Instantly share code, notes, and snippets.

@kingel
Created December 23, 2013 16:33
Show Gist options
  • Save kingel/8100148 to your computer and use it in GitHub Desktop.
Save kingel/8100148 to your computer and use it in GitHub Desktop.
function(){
var layer=new OpenLayers.Layer.Vector('Recreatie',{
protocol: new OpenLayers.Protocol.HTTP({
url: 'http://localhost:8080/lunetzorg/bestaande-bouw-migrated/'+'@@kml-categorie?categorie=Recreatie',
format: new OpenLayers.Format.KML({
extractStyles: true,
extractAttributes: true})
}),
strategies: [new OpenLayers.Strategy.Fixed()],
projection:widget.map.displayProjection
});
layer.events.on(
{"loadend":function(){
layer.map.zoomToExtent(layer.getDataExtent());
if(layer.features.length>1){
layer.map.zoomTo(layer.map.getZoom()-4)
}else{
layer.map.zoomTo(layer.map.getZoom()-4)
}
}});
return layer},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment