Permalink
Browse files

fixes #72 Parameters for default selections should be available

  • Loading branch information...
1 parent 7b67203 commit 66c5913d5b8668923136f2369cd6246c2aa0ab69 @bjornd committed Sep 3, 2012
Showing with 10 additions and 3 deletions.
  1. +7 −0 lib/world-map.js
  2. +1 −0 tests/index.html
  3. +2 −3 tests/markers.html
View
@@ -123,6 +123,13 @@ jvm.WorldMap = function(params) {
}
}
+ if (this.params.selectedRegions) {
+ this.setSelectedRegions(this.params.selectedRegions);
+ }
+ if (this.params.selectedMarkers) {
+ this.setSelectedMarkers(this.params.selectedMarkers);
+ }
+
if (this.params.series) {
this.createSeries();
}
View
@@ -29,6 +29,7 @@
<script src="../lib/vector-canvas.js"></script>
<script src="../lib/numeric-scale.js"></script>
+ <script src="../lib/ordinal-scale.js"></script>
<script src="../lib/color-scale.js"></script>
<script src="../lib/data-series.js"></script>
<script src="../lib/proj.js"></script>
View
@@ -88,6 +88,8 @@
},
regionsSelectable: true,
markersSelectable: true,
+ selectedRegions: JSON.parse( window.localStorage.getItem('jvectormap-selected-regions') || '[]' ),
+ selectedMarkers: JSON.parse( window.localStorage.getItem('jvectormap-selected-markers') || '[]' ),
onMarkerLabelShow: function(event, label, index){
label.html(label.html()+' (modified marker)');
@@ -134,9 +136,6 @@
}
});
- map.setSelectedRegions( JSON.parse( window.localStorage.getItem('jvectormap-selected-regions') || '[]' ) );
- map.setSelectedMarkers( JSON.parse( window.localStorage.getItem('jvectormap-selected-markers') || '[]' ) );
-
$('.list-markers :checkbox').change(function(){
var index = $(this).closest('li').attr('data-marker-index');

0 comments on commit 66c5913

Please sign in to comment.