佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1046|回复: 0

JS google maps不能关掉 infowindow

[复制链接]
发表于 1-7-2013 04:33 PM | 显示全部楼层 |阅读模式
按进去drop pin可以显示资料但是随便在infowindow外面按就不能把infowindow关掉我的code出现了什么问题啊?
  1. google.maps.visualRefresh = true;
  2. $("#g_map").gmap3({
  3.     map: {
  4.         options: {
  5.             center: [3.1597, 101.7000],
  6.             zoom: 11,
  7.             scrollwheel: true
  8.         }
  9.     },
  10.     marker: {
  11.         values: [{
  12.                 latLng: [3.1582, 101.7119],
  13.                 id: "mTagX",
  14.                 data: "KLCC"
  15.             }, {
  16.                 latLng: [3.1526, 101.7036],
  17.                 data: "KL Tower"
  18.             }, {
  19.                 latLng: [3.0725, 101.6072],
  20.                 data: "Sunway"
  21.             }, {
  22.                 latLng: [5.4136798, 100.3309],
  23.                 data: "Penang G Hotel"
  24.             }, {
  25.                 latLng: [3.170997, 101.66651],
  26.                 data: "Publika Solaris Dutamas"
  27.             }],
  28.         options: {
  29.             draggable: false,
  30.             labelVisible: false,
  31.             animation: google.maps.Animation.DROP
  32.         },
  33.         events: {
  34.             click: function(marker, event, context) {
  35.                 marker.set('labelVisible', true);
  36.                 var map = $(this).gmap3("get"),
  37.                         infowindow = $(this).gmap3({
  38.                     get: {
  39.                         name: "infowindow"
  40.                     }
  41.                 });
  42.                 if (infowindow) {
  43.                     infowindow.open(map, marker);
  44.                     infowindow.setContent(context.data);
  45.                 } else {
  46.                     $(this).gmap3({
  47.                         infowindow: {
  48.                             anchor: marker,
  49.                             options: {
  50.                                 content: context.data
  51.                             }
  52.                         }
  53.                     });
  54.                 }
  55.             },
  56.             closeclick: function(markers, event) {
  57.                 alert("closing : " + infowindow.getContent());
  58.             }
  59.         }
  60.     }
  61. });
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 21-9-2025 04:05 AM , Processed in 0.130589 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表