diff options
| author | Michel Etienne | 2012-11-06 18:53:29 +0100 |
|---|---|---|
| committer | Michel Etienne | 2012-11-06 18:53:29 +0100 |
| commit | 48842ac1197560b1b7f597e3e1be7c4d93f8d098 (patch) | |
| tree | dfeee03bf8ae1fb2b4a665b61c95bfe33056105f /app/assets/javascripts | |
| parent | c1c4d3fbc9231fe6b1bdd325faced49f33cdf1b2 (diff) | |
| download | chouette-core-48842ac1197560b1b7f597e3e1be7c4d93f8d098.tar.bz2 | |
add access_points and access_links managment
Diffstat (limited to 'app/assets/javascripts')
| -rw-r--r-- | app/assets/javascripts/access_points.js.coffee | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/app/assets/javascripts/access_points.js.coffee b/app/assets/javascripts/access_points.js.coffee new file mode 100644 index 000000000..c0f49ebd5 --- /dev/null +++ b/app/assets/javascripts/access_points.js.coffee @@ -0,0 +1,30 @@ +jQuery -> + x_y_change = (event) -> + if referential_projection != undefined + referential_point = new OpenLayers.Geometry.Point($('input#access_point_longitude').val(), $('input#access_point_latitude').val()).transform(new OpenLayers.Projection("EPSG:4326"), referential_projection ) + + $('input#access_point_x').val(referential_point.x) + $('input#access_point_y').val(referential_point.y) + + feature = map.getLayersByName("access_point")[0].getFeatureByFid($('input#access_point_id').val()) + google_point = new OpenLayers.LonLat($('input#access_point_longitude').val(), $('input#access_point_latitude').val()).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) + feature.move(google_point) + map.setCenter(google_point, 16, false, true) + + $('input#access_point_longitude').change(x_y_change) + $('input#access_point_latitude').change(x_y_change) + + lon_lat_change = (event) -> + if referential_projection != undefined + wgs84_point = new OpenLayers.Geometry.Point($('input#access_point_x').val(), $('input#access_point_y').val()).transform(referential_projection, new OpenLayers.Projection("EPSG:4326")) + + $('input#access_point_longitude').val( wgs84_point.x) + $('input#access_point_latitude').val( wgs84_point.y) + + feature = map.getLayersByName("stop_area")[0].getFeatureByFid($('input#access_point_id').val()) + google_point = new OpenLayers.LonLat(wgs84_point.x, wgs84_point.y).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) + feature.move(google_point) + map.setCenter(google_point, 16, false, true) + + $('input#access_point_x').change(lon_lat_change) + $('input#access_point_y').change(lon_lat_change) |
