So I managed to hack 'n slash my way to update new bubbles upon an AJAX request. I didn't see or may have missed if there is a proper way already built in so this is what I did:
PHP:
$json_arr = array();
//add an array for each bubble when possible
array_push($json_arr, '{"name": "'.$name.'", "latitude": '.$lat.', "longitude": '.$long.', "radius": 10, "fillKey": "gt50"}');
//output array into text
print implode(",",$json_arr);
jQuery/Ajax:
.done(function( msg ) {
//parse the result string into object(s)
var obj = jQuery.parseJSON('['+msg+']');
//create new bubble(s)
map.bubbles(obj);
So I managed to hack 'n slash my way to update new bubbles upon an AJAX request. I didn't see or may have missed if there is a proper way already built in so this is what I did:
PHP: $json_arr = array();
//add an array for each bubble when possible array_push($json_arr, '{"name": "'.$name.'", "latitude": '.$lat.', "longitude": '.$long.', "radius": 10, "fillKey": "gt50"}');
//output array into text print implode(",",$json_arr);
jQuery/Ajax: .done(function( msg ) { //parse the result string into object(s) var obj = jQuery.parseJSON('['+msg+']'); //create new bubble(s) map.bubbles(obj);
Is there a more efficient way to achieve this?