How to read yaml properties using javascript -


mapmarker :      source : d.marker_data      type : mapmarker      region: pune      size : 4      fill_color : blue      leader_name : leadername      markers :      - circlemarker :          type: circle_marker          latlong: 'abc'      - connector_marker :          type: icon_marker          latlong: 'pqr'      - icon_marker :          type: connector_marker          latlong: 'xyz' 

here yaml file able access property values config.color in javascript , getting color.but how property values latlong different markers ? have following code

config = this.config; self = this;

            l=config.markers.length;             for(var k=0;k<l;k++)             {               console.log(config.markers[k]);              } 

and gives output like:

object { circlemarker={...}} object { connector_marker={...}} object { icon_marker={...}} 

but want properties under individual object latlong value each marker.

here code snippest found solution :

 (var = 0; < obj.length; a++) {         var key = object.keys(obj[a])[0];         var latlong = obj[a][key][1];         console.log(latlong);     } 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -