2016-06-01 8 views
1

この質問はhereと同様に1年前に返されましたが、回答はありませんでした。私は "ドリルダウン"マップをメインマップと同じスタイルと背景にする方法を知りたいのですが。JVectorMapマルチマップドリルダウンは、ドリルダウン時に異なるスタイルを持ちますが、どのようにこのスタイルを変更することもできますか?

var regionStyling9 = {     // This style is set to the main map's regionStyle 
     initial: { 
      fill: '#E9E9E9', 
      stroke: '#505050', 
      "fill-opacity": 1, 
      "stroke-width": 1, 
      "stroke-opacity": 1 
     }, 
     hover: { fill: "#4DB870" } 
    }; 

    $(function() { 
     new jvm.MultiMap({ 
      container: $('#Chart9Map'), 
      maxLevel: 1, 
      main: { 
       map: 'us_aea_en', 
       backgroundColor: '#fff', 
       regionStyle: regionStyling9,  // Here I set the top level style to the main map      
       series: { 
        regions: [{ values: stateMapData, scale: ['#cce2ec', '#006593'], normalizeFunction: 'polynomial' }] 
       } 
      }, 
      mapUrlByCode: function(code, multiMap) { 
       return '../Scripts/JVectorMap/jquery-jvectormap-data-' + 
        code.toLowerCase() + 
        '-' + 
        multiMap.defaultProjection + 
        '-en.js'; 
      } 
     }); 
    }); 

メインチャートの場合と同様に、セカンダリチャートのスタイルにどのような影響を与えることができますか?

jVectorMap MultiMap Documentationによると、メインマップ、ドリルダウンマップのいない他のオブジェクトに対してのみ設定がある...

答えて

0

私はまた、この情報を見つけることができなかった、あなたは何を意味するか知っています。それはライブラリがこれを処理しないことは非常に奇妙です。そのようなうまく作成されたパッケージは、まだいくつかの基本を見逃しているようです。 無料版を使用していないと仮定した場合、ライセンスにはコードを変更することが許可されています。

jquery-jvectormap.jsファイルを開きます(必要な場合はそれを確認してください)。底部では あなたが行表示されます:

currentMap.params.container.hide(), that.maps[name] ? that.maps[name].params.container.show() : that.addMap(name, { 
     map: name, 
     multiMapLevel: currentMap.params.multiMapLevel + 1 
    }), that.history.push(that.maps[name]), that.backButton.show() 

変更メインマップから、このように設定を子どもたちに伝えているが(これだけ3つの余分な行を追加します):

currentMap.params.container.hide(), that.maps[name] ? that.maps[name].params.container.show() : that.addMap(name, { 
     backgroundColor: that.params.main.backgroundColor, 
     series: that.params.main.series, 
     onRegionTipShow: that.params.main.onRegionTipShow, 
     map: name, 
     multiMapLevel: currentMap.params.multiMapLevel + 1 
関連する問題