0

非常に便利なメタデータ jquery プラグインjMappingを使用してマップを中央に配置しようとしていますが、中央に配置されません。

これは、マップをあまりにも迅速に初期化しようとすること、または間違った順序で初期化しようとすることの問題ですか?ここで何が欠けていますか?

// Map init
$(function() {

// styles
var styles = [{

    //  background colour
    featureType: "water",
    elementType: "all",
        stylers: [ { 
            color: '#E7E4DD' }, { visibility: "on" }
        ]
    }, 

    { //  Turn off roads
    featureType: "road",
        stylers: [ 
            { "visibility": "off" }
        ]
    },

    { //  Turn off transit
    featureType: "transit",
        stylers: [ 
            { "visibility": "off" }
        ]
    },

    { //  Turn off administrative
    featureType: "administrative",
        stylers: [ 
            { "visibility": "off" }
        ]
    },  
    { //  country line
    featureType: "administrative.country",
    elementType: "geometry.stroke",
        stylers: [ 
            { "visibility": "on" },
            { "color": "#0068f4"},
            { "weight": "0.7"}
        ]
    },
    { //  style landscape
    featureType: "landscape",
    elementType: "all",
        stylers: [ 
            { "color": "#002E6C" }
        ]
    },

    { //  points of interest
    featureType: "poi",
        stylers: [
            { "color": "#002E6C" }
        ]
    },

    { //  labels
    elementType: "labels",
        stylers: [
            { "visibility": "off" }
        ]
}];

// map options
var mapOptions = {
    zoom: 3,
    center: new google.maps.LatLng(51.165691, 10.451526),
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    disableDefaultUI: false,
    styles: styles,
    minZoom: 3,
    maxZoom: 10
};

// call the map jMapping
$('#map').jMapping({
    map_config: mapOptions,
    default_zoom_level: 2,
    metadata_options: {type: 'html5'},
    category_icon_options: function(category){

        if (category.match('experience')) { // if the category is experience, use custom marker

          return new google.maps.MarkerImage('/wp-content/themes/ichron/assets/map/images/marker.png');

       } 

     }
});

});

4

1 に答える 1