Created
December 17, 2010 04:01
-
-
Save iwillig/744471 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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