我正在尝试设置一个自定义的 Google 地图,该地图的旁边会有一个企业目录。
请在本文末尾查看我的示例链接。
您当前可以单击绿色图标并打开自定义弹出窗口,但我需要在侧边栏中的地图上创建公司链接,单击时将在地图上打开相应的弹出窗口。
请让我知道我需要什么,以便在单击地图旁边的侧边栏中的链接时打开每个公司弹出窗口。
这是示例,减去我要询问的侧边栏上的链接:http: //digitour360.com/test-map/
这是我的示例中使用的 Javascript,如果这有助于确定如何调用弹出窗口:
<!-- your api key is used here -->
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.stylizedmap.min.js"></script>
<script type="text/javascript">
jQuery().ready(function () {
var a = [
"http://2.s3.envato.com/files/29891006/mountains%206.jpg",
"http://0.s3.envato.com/files/29962392/mountains%2014.jpg",
"http://2.s3.envato.com/files/29035356/oetztal_8800.jpg",
"http://1.s3.envato.com/files/22469879/IMG_3536.jpg",
"http://0.s3.envato.com/files/22441185/IMG_6149_2.jpg"
];
var b = [
"http://1.s3.envato.com/files/28915052/Garden.JPG"
];
var sparkles = [
"images/sparkles1.jpg"
];
var accent = [
"images/accent.jpg"
];
var dougherty = [
"images/dougherty.jpg"
];
var centurion = [
"images/centurion.jpg"
];
var gardner = [
"images/gardner.jpg"
];
$("#map").StylizedMap({
zoomLevel: 17,
styles: $().StylizedMap.styles.gray,
center: {
lat: 35.884773,
long: -78.745691
},
locations: [{
lat: 35.884752,
long: -78.74959,
title: 'Accent Imaging, Inc.<br/><a href="http://www.accentimaging.com" target="_blank">www.accentimaging.com →</a>',
sub_title: "8121 Brownleigh Drive, Raleigh, NC 27617",
slides: accent,
active: true
}, {
lat: 35.885556,
long: -78.749399,
title: 'Sparkles Restoration<br/><a href="http://www.sparkkles.com" target="_blank">www.sparkkles.com →</a>',
sub_title: "738 Lincoln Road Miami Beach, FL 33139",
slides: sparkles
}, {
lat: 35.882468,
long: -78.748927,
title: 'Centurion Construction<br/><a href="http://www.centurionconstruction.com" target="_blank">www.centurionconstruction.com →</a>',
sub_title: "3301 Glen Royal Rd, Raleigh, NC 27617",
slides: centurion
}, {
lat: 35.886834,
long: -78.749587,
title: 'Gardner-Marsh Gas Equipment<br/><a href="http://www.gardnermarsh.com" target="_blank">www.gardnermarsh.com →</a>',
sub_title: "679 North Michigan Ave. Chicago, IL 60611",
slides: gardner
}, {
lat: 35.885821,
long: -78.749571,
title: 'Dougherty Equipment Company<br/><a href="http://www.doughertyequipment.com" target="_blank">www.doughertyequipment.com →</a>',
sub_title: "679 North Michigan Ave. Chicago, IL 60611",
slides: dougherty
}, {
lat: 47.6632853,
long: -122.300746,
title: 'Apple Seattle Store',
sub_title: "2656 NE University Village Street Seattle, WA 98105",
slides: b
}, {
lat: 36.1276138,
long: -115.16803270000003,
title: 'Apple Las Vegas store',
sub_title: "3200 Las Vegas Blvd. Las Vegas, NV 89109"
}, {
lat: 30.258303,
long: -97.807986,
title: 'Apple Austin store',
sub_title: "2901 S. Capital of Texas Highway Austin, TX 78746",
slides: b
}]
})
});
</script>