Hello! I’m building a custom Google map from an HTML element. I have a Database, each element is a list of places. So I need to send such an element to my HTML box to show markers. Is there any ways to do that?
I need to form a Javascript array of objects based on this data.
upd 1. Not the best solution. If you have commas in the things, it’s gonna ruin the whole process. I guess, you need to split by ", " and regular expression [A-Z]. Because in a normal sentence, after commas only lower-case letter can follow.
So all you need is to do search in quotes marks. Something like this:
The result:
It gives you string with commas. Then you need to create one-dimensional array:
var array = string.split(',');
Then do it as many times as you need to get other data and create your set of object or multi-dimensional arrays.