Tidy things up a bit.
This commit is contained in:
parent
0c061a6f65
commit
209dece7d3
3 changed files with 52 additions and 38 deletions
|
@ -71,29 +71,32 @@
|
|||
var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik", {
|
||||
displayOutsideMaxExtent: true,
|
||||
wrapDateLine: true,
|
||||
attribution: attribution
|
||||
attribution: attribution
|
||||
});
|
||||
map.addLayer(mapnik);
|
||||
} else {
|
||||
} else {
|
||||
var osmarender = new OpenLayers.Layer.OSM.Osmarender("Osmarender", {
|
||||
displayOutsideMaxExtent: true,
|
||||
wrapDateLine: true,
|
||||
attribution: attribution
|
||||
attribution: attribution
|
||||
});
|
||||
map.addLayer(osmarender);
|
||||
}
|
||||
map.addLayer(osmarender);
|
||||
}
|
||||
|
||||
if (args.marker) {
|
||||
var markers = new OpenLayers.Layer.Markers();
|
||||
map.addLayer(markers);
|
||||
markers.addMarker( new OpenLayers.Marker(new OpenLayers.LonLat(args.marker[1], args.marker[0]).transform(map.displayProjection, map.getProjectionObject())));
|
||||
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(args.marker[1], args.marker[0]).transform(map.displayProjection, map.getProjectionObject())));
|
||||
map.marker = true;
|
||||
}
|
||||
if (args.bbox) {
|
||||
}
|
||||
|
||||
if (args.bbox) {
|
||||
var bounds = OpenLayers.Bounds.fromArray(args.bbox).transform(map.displayProjection, map.getProjectionObject());
|
||||
map.zoomToExtent(bounds)
|
||||
} else {
|
||||
map.zoomToMaxExtent();
|
||||
map.zoomToMaxExtent();
|
||||
}
|
||||
|
||||
var size = map.getSize();
|
||||
if (size.h > 320) {
|
||||
map.addControl(new OpenLayers.Control.PanZoomBar());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue