| 12 | | <script type="text/javascript" src="/ol/lib/OpenLayers.js"></script> |
|---|
| 13 | | <script |
|---|
| 14 | | type="text/javascript" |
|---|
| 15 | | src="ol.js" |
|---|
| 16 | | tal:attributes="src string:${context/absolute_url}/ol.js" |
|---|
| 17 | | > |
|---|
| 18 | | </script> |
|---|
| | 12 | <script |
|---|
| | 13 | src="key" |
|---|
| | 14 | tal:attributes="src string:http://maps.google.com/maps?file=api&v=2&key=${context/@@ol-gmaps-key}" |
|---|
| | 15 | type="text/javascript" |
|---|
| | 16 | > |
|---|
| | 17 | </script> |
|---|
| | 18 | <script src="http://openlayers.org/api/OpenLayers.js"></script> |
|---|
| | 19 | <script |
|---|
| | 20 | type="text/javascript" |
|---|
| | 21 | src="../@@ol.js" |
|---|
| | 22 | tal:attributes="src string:${context/absolute_url}/@@ol.js" |
|---|
| | 23 | > |
|---|
| | 24 | </script> |
|---|
| | 25 | <script type="text/javascript"> |
|---|
| | 26 | var map, base, marker, coords; |
|---|
| | 27 | var SHADOW_Z_INDEX = 10; |
|---|
| | 28 | var MARKER_Z_INDEX = 11; |
|---|
| | 29 | |
|---|
| | 30 | function init() { |
|---|
| | 31 | map = new OpenLayers.Map('map'); |
|---|
| | 32 | base = new OpenLayers.Layer.Google( |
|---|
| | 33 | "Base", { |
|---|
| | 34 | isBaseLayer: true, |
|---|
| | 35 | type: G_PHYSICAL_MAP, |
|---|
| | 36 | //sphericalMercator: true |
|---|
| | 37 | } |
|---|
| | 38 | ); |
|---|
| | 39 | marker = new OpenLayers.Layer.Vector( |
|---|
| | 40 | "Marker", |
|---|
| | 41 | { |
|---|
| | 42 | styleMap: new OpenLayers.StyleMap({ |
|---|
| | 43 | externalGraphic: "http://openlayers.org/dev/img/marker-gold.png", |
|---|
| | 44 | backgroundGraphic: "http://openlayers.org/dev/examples/marker_shadow.png", |
|---|
| | 45 | backgroundXOffset: 0, |
|---|
| | 46 | backgroundYOffset: -7, |
|---|
| | 47 | graphicZIndex: MARKER_Z_INDEX, |
|---|
| | 48 | backgroundGraphicZIndex: SHADOW_Z_INDEX, |
|---|
| | 49 | pointRadius: 10 |
|---|
| | 50 | }), |
|---|
| | 51 | reproject: true, |
|---|
| | 52 | isBaseLayer: false, |
|---|
| | 53 | projection |
|---|
| | 54 | rendererOptions: {yOrdering: true} |
|---|
| | 55 | } |
|---|
| | 56 | ); |
|---|
| | 57 | coords = pleiades_oljs.centroid.coordinates; |
|---|
| | 58 | map.addLayers([base, marker]); |
|---|
| | 59 | //map.addControl(new OpenLayers.Control.LayerSwitcher()); |
|---|
| | 60 | map.setCenter(new OpenLayers.LonLat(coords[0], coords[1]), 5); |
|---|
| | 61 | marker.features.push( |
|---|
| | 62 | new OpenLayers.Feature.Vector( |
|---|
| | 63 | new OpenLayers.Geometry.Point(coords[0], coords[1]) |
|---|
| | 64 | ) |
|---|
| | 65 | ); |
|---|
| | 66 | } |
|---|
| | 67 | </script> |
|---|