-function addBoxToMap(boxbounds, id, outline) {
- if (!vectors) {
- // Be aware that IE requires Vector layers be initialised on page load, and not under deferred script conditions
- vectors = new OpenLayers.Layer.Vector("Boxes", {
- displayInLayerSwitcher: false
- });
- map.addLayer(vectors);
- }
- var geometry;
- if (outline) {
- vertices = boxbounds.toGeometry().getVertices();
- vertices.push(new OpenLayers.Geometry.Point(vertices[0].x, vertices[0].y));
- geometry = proj(new OpenLayers.Geometry.LineString(vertices));
- } else {
- geometry = proj(boxbounds.toGeometry());
- }
- var box = new OpenLayers.Feature.Vector(geometry, {}, {
- strokeWidth: 2,
- strokeColor: '#ee9900',
- fillOpacity: 0
- });
- box.fid = id;
-
- vectors.addFeatures(box);
-
- return box;
-}
-
-function openMapPopup(marker, description) {
- closeMapPopup();
-
- popup = new OpenLayers.Popup.FramedCloud("popup", marker.lonlat, null,
- description, marker.icon, true);
- popup.setBackgroundColor("#E3FFC5");
- map.addPopup(popup);
-
- return popup;