+ feature.popup = new OpenLayers.Popup.FramedCloud(
+ feature.attributes.id, location, null,
+ "<p>" + feature.attributes.id + "</p>",
+ null, true, function (e) { map.noteControl.unselect(feature) }
+ );
+
+ map.addPopup(feature.popup);
+// feature.popup.show();
+ }
+
+ function noteUnselected(o) {
+ var feature = o.feature;
+
+ map.removePopup(feature.popup);
+ delete feature.popup;
+ }
+
+ function addNote() {
+ map.noteLayer.setVisibility(true);
+ map.noteLayer.addNote(map.getCenter());
+ }
+
+ function allowNoteReports() {
+ if (map.getZoom() > 11) {
+ $("#createnoteanchor").show();
+ } else {
+ $("#createnoteanchor").hide();
+ }
+ }
+
+ $(document).ready(mapInit);
+ $(document).ready(installEditHandler);
+ $(document).ready(handleResize);
+
+ $(window).resize(function() {
+ var centre = map.getCenter();
+ var zoom = map.getZoom();
+
+ handleResize();
+
+ map.setCenter(centre, zoom);
+ });
+
+ $(document).ready(function () {
+ $("#exportanchor").click(function (e) {
+ $.ajax({ url: "<%= url_for :controller => :export, :action => :start %>" });
+ Event.stop(e);
+ });
+
+ <% if params[:action] == 'export' -%>
+ $.ajax({ url: "<%= url_for :controller => :export, :action => :start %>" });
+ <% end -%>
+
+ <% if params[:query] -%>
+ doSearch("<%= params[:query] %>");
+ <% end %>
+ });