Skip to content

Instantly share code, notes, and snippets.

@iwillig
Created December 17, 2010 04:01
Show Gist options
  • Select an option

  • Save iwillig/744471 to your computer and use it in GitHub Desktop.

Select an option

Save iwillig/744471 to your computer and use it in GitHub Desktop.
function loadMap() {
var bbox = new OpenLayers.Bounds(156543.03389988,
703424.66634662,
1484712.8371452,
1347941.6887318);
map = new OpenLayers.Map({
div: "map",
allOverlays: true
});
var osm = new OpenLayers.Layer.OSM();
var gmap = new OpenLayers.Layer.Google("Google Streets", {visibility: false});
var features = new OpenLayers.Layer.Vector("Features", {
strategies: [
new OpenLayers.Strategy.Fixed()
//new OpenLayers.Strategy.Cluster()
],
projection: map.getProjection(),
protocol: new OpenLayers.Protocol.HTTP({
url: "http://localhost/amaps/geojson.json",
params: {
},
format: new OpenLayers.Format.GeoJSON(),
}),
styleMap: new OpenLayers.StyleMap({
"default": {
fillColor: "#8aeeef",
strokeColor: "#32a8a9"
},
"select": {
fillColor: "#8aeeef",
strokeColor: "#32a8a9"
}
})
});
map.addLayers([gmap,osm,features]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToExtent(bbox);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment