Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
<html> <head> <h1> Select Blackout Area </h1> <script type="text/javascript" src="javascripts/jquery-1.3.2.js"></script> <script type="text/javascript" src="javascripts/jquery.timers-1.2.js"></script> <!-- bring in the OpenLayers javascript library here we bring it from the remote sitebut you could easily serve up this javascript yourself --> <script src="http://www.openlayers.org/api/OpenLayers.js"></script> <script src="/javascripts/OpenStreetMap.js"></script> <script type="text/javascript"> // making this a global variable so that it is accessible for // debugging/inspecting in Firebug var mappolygonControllayerMapnikpolygonLayer; var poly_mode = false; var pointsvertices; var bounds = -12525-6550; var navControl = Navigation; map = "map" controls: navControl //new OpenLayers.Control.PanZoomBar(), //new OpenLayers.Control.LayerSwitcher(), Attribution numZoomLevels: 10 //restrictedExtent: bounds.clone().transform(EPSG4326, EPSG900913), restrictedExtent: boundsclonetransform "EPSG:4326" "EPSG:900913" maxExtent: boundsclonetransform "EPSG:4326" "EPSG:900913" maxResolution: "auto" units: 'm' projection: "EPSG:900913" displayProjection: "EPSG:4326" ; //actually draws the map layerMapnik = OSMMapnik"Mapnik" displayOutsideMaxExtent: false wrapDateLine: true //numZoomLevels: 4 ; polygonLayer = Vector"Polygon Layer"; mapaddLayerlayerMapnik; mapaddLayerpolygonLayer; <% if @blackout %> drawExisting; <% end %> mapaddControlMousePosition; mapaddControlLayerSwitcher; var polyOptions = sides: 4; polygonControl = DrawFeaturepolygonLayer OpenLayersHandlerRegularPolygon handlerOptions: polyOptions; mapsetCenter003; //polygonControl.activate(); mapaddControlpolygonControl; mapzoomToMaxExtent; var feature; polygonLayereventsregister"beforefeatureadded"featurefunctionevt //only one circle at a time points = evtfeaturegeometrygetVertices; console.logpoints; clearPoly; ;//end attempt at events registration //end init <% if @blackout %> console.log"Deleting current blackout from rails"; var url = "/blackout/delete?id=" + <%=@blackoutid%> +"&program_id=" + <%=@programid%>; windowlocation = url; <% end %> //end deleteBlackout //call the rails route to save the polygon to the database console.log"Saving current blackout"; console.logpoints; console.logpointToPixelpoints0; console.logmapgetLonLatFromPixelpointToPixelpoints0transform"EPSG:4326"mapgetProjectionObject; console.logmapgetLonLatFromPixelpointToPixelpoints0; var url = "/blackout/create?point1x="; url += points0x+"&point1y="+points0y; url += "&point2x=" + points1x+"&point2y="+points1y; url += "&point3x=" + points2x+"&point3y="+points2y; url += "&point4x=" + points3x+"&point4y="+points3y; url += "&id=" + <%=@programid%>; // window.location = url; // end saveBlackout //converts a point to a pixel for lat/long conversions var pixel = pointxpointy; return pixel; //end point to pixel //draws the existing blackout <% if @blackout%> vertices = ; vertices0 = Point<%=@blackoutpoint1x %><%=@blackoutpoint1y%>; vertices1 = Point<%=@blackoutpoint2x %><%=@blackoutpoint2y%>; vertices2 = Point<%=@blackoutpoint3x %><%=@blackoutpoint3y%>; vertices3 = Point<%=@blackoutpoint4x %><%=@blackoutpoint4y%>; var ring = LinearRingvertices; var square = Polygonring; var vector = Vectorsquare; var features = ; features0 = vector; console.logsquare; polygonLayeraddFeaturesfeatures; console.logpolygonLayerfeatures0geometrygetVertices; <% end %> //end drawExisting //for debugging polygonLayerredraw; console.log"pL layer redrawn"; // layerMapnik.redraw(); //end redrawVL polygonControlactivate poly_mode = true; //end activate poly_mode = false; polygonControldeactivate //end deactivate console.log"Clearing existing polygons"; console.logpolygonLayerfeatureslength; polygonLayerdestroyFeatures; polygonLayerredraw; //end clearPoly </script> </head> <body onload="init()"> <ul id="controls"><b>Map Controls</b> <% if !@blackout %> <input type="radio" name="type" value="none" id="noneToggle" onclick="polygonControl.deactivate()" checked="checked" /> <label for="noneToggle">navigate</label> <input type="radio" name="type" value="polygon" id="polygonToggle" onclick="polygonControl.activate()" /> <label for="polygonToggle">draw polygon</label> <% end %> <input type=BUTTON value="Clear Polygons" name="mySubmit" onClick="clearPoly()"> <input type=BUTTON value="Redraw Vector Layer" name="mySubmit" onClick="redrawVL()"> <input type=BUTTON value="Save Blackout" name="Save Blackout" onClick="saveBlackout()"> <input type=BUTTON value="Delete Blackout" name="Delete Blackout" onClick="deleteBlackout()"> </ul> <div id="map" class="small_map"></div> </body> </html> |