// This function might be passed either an OpenLayers.LonLat (so has // lon and lat) or an OpenLayers.Geometry.Point (so has x and y) function fixmystreet_update_pin(lonlat) { lonlat.transform( fixmystreet.map.getProjectionObject(), new OpenLayers.Projection("EPSG:4326") ); document.getElementById('fixmystreet.latitude').value = lonlat.lat || lonlat.y; document.getElementById('fixmystreet.longitude').value = lonlat.lon || lonlat.x; } function fixmystreet_activate_drag() { fixmystreet.drag = new OpenLayers.Control.DragFeature( fixmystreet.markers, { onComplete: function(feature, e) { fixmystreet_update_pin( feature.geometry.clone() ); } } ); fixmystreet.map.addControl( fixmystreet.drag ); fixmystreet.drag.activate(); } function fms_markers_list(pins, transform) { var cols = { 'red':'R', 'green':'G', 'blue':'B', 'purple':'P' }; var markers = []; for (var i=0; i 0 ) { $('#form_category').change( form_category_onchange ); } }); $('#side-form').show(); /* For some reason on IOS5 if you use the jQuery show method it * doesn't display the JS validation error messages unless you do this * or you cause a screen redraw by changing the phone orientation. * NB: This has to happen after the call to show() */ if ( navigator.userAgent.match(/like Mac OS X/i)) { document.getElementById('side-form').style.display = 'block'; } $('#side').hide(); $('#sub_map_links').hide(); fixmystreet.page = 'new'; location.hash = 'report'; } });