0๐
- LMarker properties accepts latLng: object | array, just use a traversal method to build required format.
To solve your specific problem use the following snippet in your api request:
axios.get('http://api/api/v1/successgps').then((response) => {
// this.markers = response.data.successgps;
// var technicianlocation = '48.5206828,19.8217017';
// console.log(technicianlocation.split(',')[0]);
response.data.successgps.forEach((element) => {
this.markers.push({
technicianlocation: [element.technicianlocation.split(',')[0], element.technicianlocation.split(',')[1]],
});
});
});
- You can find in the official VueLeaflet documentation: https://vue2-leaflet.netlify.app/components/LCircleMarker.html#props
Source:stackexchange.com