Hi I have been playing around with this for a while but no solution yet.
There are three parts to my code, the aim is to create a custom word to insert into a call for a url, so a specific kml file is loaded onto my webmap.
A function to generate a word by clicking a button on my website.(there are 6 other buttons that once clicked create a word)
var pub = []; function myFunction7() { pub.push("pub");Once the words have been created, this step adds the variable to an array. The array will = the words needed to match the url.
var url = [pub]So var url = bar if pub button is clicked.
I would like a new variable to = the words in the array that is generated after the user clicks the buttons.
var name = url var src = "https://www.dropbox.com/"+name+".kml?dl=1";
The problem comes at step 3. Instead of loading the kml the map disappears and url to the kml file is not read so nothing is loaded. Buttons all work, I have tested up to step 2 by printing the result on the web page.
Thanks for any help!
var name = url.join('');If you get the desired src the problem must be somewhere else.