Created
August 22, 2012 21:26
-
-
Save benheb/3429540 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
updateFeature: function(f){ | |
var guid = f.layer; | |
var f_id = f.feature; | |
var time = new Date(); | |
var features = {}; | |
features.id = f.feature; | |
features.geometry = f.geometry | |
jq('#attribute-form').children('input').each(function (i,f) { | |
var name = jq(this).attr('id'); | |
var attr = jq(this).val(); | |
features[name] = attr; | |
}); | |
//update new feature | |
F1.Maker.current_map.updateFeatures(guid, [features]); | |
setTimeout(function(){ | |
F1.Maker.current_map.deleteFeatures(guid, [features.id]); | |
F1.Maker.current_map.addFeatures(guid, [features], false, true); | |
F1.Maker.current_map.saveFeatures(guid); | |
},200); | |
jq('#attribute-form input[type="text"]').val(''); | |
jq('#annotation-controls').hide(); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment