0

我正在尝试在 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>
4

1 回答 1

0

解决了:

$('#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);
        });
    }});
于 2013-09-13T13:17:11.797 回答