在storeLocator上设置自定义商店标记.在谷歌商店
Set custom store marker on storeLocator.Store in Google
我试图为我的每个商店设置一个自定义标记。使用Google storelocator,有一个storelocator。使用. setmarker选项存储。
I tried a lot
var store = new storeLocator.Store(store_id, position, storeFeatureSet, storeProps);
var markerPin = new google.maps.Marker(
icon: 'http://url-to-marker.png'
});
store.setMarker(markerPin);
我一直试图在谷歌上找到一些东西,但没有太多关于storelocator项目。
我设法找到了存储定位器项目的GIT存储库。在这个存储库中有示例示例和演示标记位置的文件。如果您深入到examples目录并查看文件places.js。您可以找到如何用标记填充地方的代码。我正在添加一个小代码片段,有关详细概述,您可以查看整个项目。
google.maps.event.addDomListener(window, 'load', function() {
var map = new google.maps.Map(document.getElementById('map-canvas'), {
center: new google.maps.LatLng(-28, 135),
zoom: 4,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var panelDiv = document.getElementById('panel');
var data = new PlacesDataSource(map);
var view = new storeLocator.View(map, data);
var markerSize = new google.maps.Size(24, 24);
view.createMarker = function(store) {
return new google.maps.Marker({
position: store.getLocation(),
icon: new google.maps.MarkerImage(store.getDetails().icon, null, null,
null, markerSize)
});
};
new storeLocator.Panel(panelDiv, {
view: view
});
});
相关文章:
- 从谷歌自定义搜索返回随机帖子
- 如何从谷歌自定义搜索下载搜索结果
- 如何将从谷歌自定义搜索API获取的数据放入复选框列表
- 谷歌自定义搜索参考部门
- 如何使用javascript为谷歌自定义搜索添加价值
- 谷歌自定义搜索结果通过代理显示错误
- 在我的谷歌自定义搜索引擎从服务器获取数据后,我如何激发一些javascript代码
- 如何风格谷歌自定义搜索引擎,使其不会't显示为块元素
- 使用谷歌自定义搜索引擎,有一点隐私
- 在谷歌自定义搜索引擎 V2 代码中执行默认查询
- 谷歌自定义搜索 - 从网址参数手动加载/执行
- 从文本链接调用谷歌自定义搜索叠加层
- 带有两个单选按钮的谷歌自定义搜索
- 如何使用我的搜索栏与谷歌自定义搜索
- 自定义谷歌自定义搜索jsapi(查询字符串)
- 谷歌的附加链接搜索框,用于谷歌自定义搜索
- 我们如何配置谷歌自定义搜索使用API与PHP
- 谷歌自定义搜索引擎多参数查询
- 谷歌自定义搜索API javascript
- 谷歌自定义搜索图像只