Using A Relative Path In Javascript To Set Google Map Icon
I've set the icon image in my Google map using an absolute url as follows: icon: 'http://mysite/wp-content/plugins/my_plugin/images/icon1.png' I set the image in this script: ht
Solution 1:
Relative paths should work fine, but they need to be relative to the path of the page with the map, not relative to the JS script. If you're using the map script on different pages requiring different relative paths, than a path starting with a slash (e.g. /wp-content/plugins/my_plugin/images/icon1.png
) is the best option.
Post a Comment for "Using A Relative Path In Javascript To Set Google Map Icon"