From 071057198df57914dbec61feedb74ab571df67a3 Mon Sep 17 00:00:00 2001 From: Arvind Date: Tue, 12 Jun 2012 18:14:46 +0530 Subject: [PATCH] Publish the annotation, added JSON style saving to a annotation --- myVector.js | 15 +++++++++++---- openlayers.html | 5 ++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/myVector.js b/myVector.js index 165238e..42f388c 100644 --- a/myVector.js +++ b/myVector.js @@ -10,7 +10,7 @@ var box_extents = [ var box_extents1 = [ [4263.0000, -1630.33337, 4559.0000, -1342.33337] ]; -var myJSON = {}; +var myJSON = []; // avoid pink tiles OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3; OpenLayers.Util.onImageLoadErrorColor = "transparent"; @@ -240,9 +240,7 @@ function myfeatureadded(myObj) "bottom": bottom, "right": right, "left": left, - "name": name, - "character": $("#character-value").text(), - "material": $("#material-value").text() + "name": name }; } else @@ -305,3 +303,12 @@ function allowPan(element) { } } onresize=function(){ resize();}; +function publish() +{ + console.log(myJSON); + $.post("http://192.168.100.56:82/submit", JSON.stringify(myJSON), function(data) + { + alert(data); + } + ); +} \ No newline at end of file diff --git a/openlayers.html b/openlayers.html index e2db963..d17be37 100644 --- a/openlayers.html +++ b/openlayers.html @@ -39,7 +39,9 @@ function treeClose() { $('#annotation-tree').hide(); - myJSON['attribs'] = attribs; + attribs["character"] = $("#character-value").text(); + attribs["material"] = $("#material-value").text(); + myJSON.push(attribs); } @@ -71,6 +73,7 @@
+
Character:
-- 1.7.10.4