|
按进去drop pin可以显示资料但是随便在infowindow外面按就不能把infowindow关掉。我的code出现了什么问题啊? - google.maps.visualRefresh = true;
- $("#g_map").gmap3({
- map: {
- options: {
- center: [3.1597, 101.7000],
- zoom: 11,
- scrollwheel: true
- }
- },
- marker: {
- values: [{
- latLng: [3.1582, 101.7119],
- id: "mTagX",
- data: "KLCC"
- }, {
- latLng: [3.1526, 101.7036],
- data: "KL Tower"
- }, {
- latLng: [3.0725, 101.6072],
- data: "Sunway"
- }, {
- latLng: [5.4136798, 100.3309],
- data: "Penang G Hotel"
- }, {
- latLng: [3.170997, 101.66651],
- data: "Publika Solaris Dutamas"
- }],
- options: {
- draggable: false,
- labelVisible: false,
- animation: google.maps.Animation.DROP
- },
- events: {
- click: function(marker, event, context) {
- marker.set('labelVisible', true);
- var map = $(this).gmap3("get"),
- infowindow = $(this).gmap3({
- get: {
- name: "infowindow"
- }
- });
- if (infowindow) {
- infowindow.open(map, marker);
- infowindow.setContent(context.data);
- } else {
- $(this).gmap3({
- infowindow: {
- anchor: marker,
- options: {
- content: context.data
- }
- }
- });
- }
- },
- closeclick: function(markers, event) {
- alert("closing : " + infowindow.getContent());
- }
- }
- }
- });
复制代码 |
|