mysql - Javascript input weird data shown -


i tried shows datas form leaflet shape, shows me weird, , don't want this. how can remove latlng thing? code:`

map.on(l.draw.event.created, function (e) {     map.addlayer(e.layer);     var points = e.layer.getlatlngs();   puncte1= points.join(","); $('#geo').val(puncte1); }); 

` see in input: latlng(44.93294, 26.00524),latlng(44.92395, 26.05433),latlng(44.94351, 26.05776), , want see: 44.93294, 26.00524, 44.92395, 26.05433; shortly, coordinates. how can this? use leaflet draw , mysql database

you can strip unneeded parts out of string regex since api docs don't seem reflect reality:

points.join(',').match(/([\d\.]+)/g).join(',') 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -