【问题标题】:Multiple Markers on jquery.ui.mapsjquery.ui.maps 上的多个标记
【发布时间】:2013-09-12 14:02:14
【问题描述】:

我正在尝试在 jquery 地图上添加多个标记但没有任何成功:

<script type="text/javascript" src="js/jquery.ui.map.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script>
//<![CDATA[
    $('#googlemaps').gmap({'center': '44.639391, -63.672101', 'zoom': 10, 'disableDefaultUI':true, 'callback': function() {
        var self = this;
        self.addMarker({'position': this.get('map').getCenter() }).click(function() {
            self.openInfoWindow({ 'content': 'Company Name' }, this);
        });
    }});
//]]>
</script>

【问题讨论】:

  • 需要更多信息来确定问题。

标签: jquery google-maps maps


【解决方案1】:

已解决:

$('#googlemaps').gmap({'center': 'your first coords', 'zoom': 10, 'disableDefaultUI':true, 'callback': function() {
        var self = this;
        self.addMarker({'position': this.get('map').getCenter() }).click(function() {
            self.openInfoWindow({ 'content': 'Your 1st Marker Name' }, this);
        });
               self.addMarker({'position': 'your second coords' }).click(function() {
            self.openInfoWindow({ 'content': 'Your 2nd Marker Name' }, this);
        });
    }});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-27
    • 1970-01-01
    • 1970-01-01
    • 2019-09-18
    • 2010-10-11
    相关资源
    最近更新 更多