【发布时间】:2019-06-18 01:03:43
【问题描述】:
我使用了Google Maps Clustering,它的工作方式符合我的预期。
但是,我在 MarkerClusterer - imagePath 中遇到了一个奇怪的问题。当我设置这个时..
imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m',
它工作正常。但是,当我这样做时..
var imgpath = '<?= SITE_ROOT_IMAGE_DEFAULT ; ?>m3.png';
imagePath: imgpath,
并提醒它给我正确的相对路径,/var/www/html/my-app/webroot/img/m3.png 我下载了这张图片。但它不起作用。
我也尝试通过http 添加。
imagePath: 'http://localhost/my-app/img/m3.png',
我可以看到我的图像,但效果不佳。
仅供参考,我还在本地服务器中下载了我的 markerclusterer.js 库,并且仅从本地服务器请求它。我正在使用Cakephp 3.x folder structure。
我也尝试过不同的方法,比如..
imagePath: "../img/m", 但它也不起作用。
有人可以指导我在这里做错了什么吗?为什么我的imagePath 没有被占用?
【问题讨论】:
标签: javascript php google-maps google-maps-api-3 google-maps-markers