Skip to content

Commit 9bbe343

Browse files
committed
docs(examples): fix examples viewer
1 parent c30e5d1 commit 9bbe343

6 files changed

+112
-18
lines changed

examples/0512-markers-clustering-10000-markers-example-no-watch.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link rel="stylesheet" href="../bower_components/leaflet.markercluster/dist/MarkerCluster.Default.css" />
1414
<script>
1515
var app = angular.module("demoapp", ['ui-leaflet']);
16-
app.controller("MarkersClustering10000MarkersController", ["$scope", "$http", "leafletData",
16+
app.controller("MarkersClustering10000MarkersNoWatchController", ["$scope", "$http", "leafletData",
1717
function($scope, $http, leafletData) {
1818

1919
var addressPointsToMarkers = function(points) {
@@ -79,7 +79,7 @@
7979
</script>
8080
</head>
8181

82-
<body ng-controller="MarkersClustering10000MarkersController">
82+
<body ng-controller="MarkersClustering10000MarkersNoWatchController">
8383
<leaflet lf-center="center" markers="markers" layers="layers" event-broadcast="events" watch-options="watchOptions" width="100%" height="480px">
8484
</leaflet>
8585
<h1>Marker clustering example (10000 markers)</h1>

examples/0601-mixed-geojson-events-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
});
147147
layer.bringToFront();
148148
$scope.selectedCountry = feature;
149-
console.log(feature);
149+
//console.log(feature);
150150
}
151151

152152
// Get the countries data from a JSON

examples/js/controllers.js

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3253,7 +3253,54 @@ var app = angular.module('webapp');
32533253
$http.get("json/realworld.10000.json").success(function(data) {
32543254
$scope.markers = addressPointsToMarkers(data);
32553255
});
3256-
}]);"markercluster",
3256+
}]);
3257+
app.controller("MarkersClustering10000MarkersNoWatchController", ["$scope", "$http", "leafletData",
3258+
function($scope, $http, leafletData) {
3259+
var addressPointsToMarkers = function(points) {
3260+
return points.map(function(ap) {
3261+
return {
3262+
layer: 'realworld',
3263+
lat: ap[0],
3264+
lng: ap[1]
3265+
};
3266+
});
3267+
};
3268+
angular.extend($scope, {
3269+
center: {
3270+
lat: -37.9212959167,
3271+
lng: 175.5604435167,
3272+
zoom: 11
3273+
},
3274+
watchOptions: {
3275+
markers: {
3276+
type: null,
3277+
individual: {
3278+
type: null
3279+
}
3280+
}
3281+
},
3282+
events: {
3283+
map: {
3284+
enable: ['moveend', 'popupopen'],
3285+
logic: 'emit'
3286+
},
3287+
marker: {
3288+
enable: [],
3289+
logic: 'emit'
3290+
}
3291+
},
3292+
layers: {
3293+
baselayers: {
3294+
osm: {
3295+
name: 'OpenStreetMap',
3296+
type: 'xyz',
3297+
url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
3298+
}
3299+
},
3300+
overlays: {
3301+
realworld: {
3302+
name: "Real world data",
3303+
type: "markercluster",
32573304
visible: true
32583305
}
32593306
}

examples/js/controllers/MarkersClustering10000MarkersController.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,4 @@
4444
$http.get("json/realworld.10000.json").success(function(data) {
4545
$scope.markers = addressPointsToMarkers(data);
4646
});
47-
}]);"markercluster",
48-
visible: true
49-
}
50-
}
51-
}
52-
});
53-
$http.get("json/realworld.10000.json").success(function(data) {
54-
leafletData.getDirectiveControls().then(function (controls) {
55-
var markers = addressPointsToMarkers(data)
56-
controls.markers.create(markers ,$scope.markers);
57-
$scope.markers = markers;
58-
});
59-
});
6047
}]);
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
app.controller("MarkersClustering10000MarkersNoWatchController", ["$scope", "$http", "leafletData",
2+
function($scope, $http, leafletData) {
3+
var addressPointsToMarkers = function(points) {
4+
return points.map(function(ap) {
5+
return {
6+
layer: 'realworld',
7+
lat: ap[0],
8+
lng: ap[1]
9+
};
10+
});
11+
};
12+
angular.extend($scope, {
13+
center: {
14+
lat: -37.9212959167,
15+
lng: 175.5604435167,
16+
zoom: 11
17+
},
18+
watchOptions: {
19+
markers: {
20+
type: null,
21+
individual: {
22+
type: null
23+
}
24+
}
25+
},
26+
events: {
27+
map: {
28+
enable: ['moveend', 'popupopen'],
29+
logic: 'emit'
30+
},
31+
marker: {
32+
enable: [],
33+
logic: 'emit'
34+
}
35+
},
36+
layers: {
37+
baselayers: {
38+
osm: {
39+
name: 'OpenStreetMap',
40+
type: 'xyz',
41+
url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
42+
}
43+
},
44+
overlays: {
45+
realworld: {
46+
name: "Real world data",
47+
type: "markercluster",
48+
visible: true
49+
}
50+
}
51+
}
52+
});
53+
$http.get("json/realworld.10000.json").success(function(data) {
54+
leafletData.getDirectiveControls().then(function (controls) {
55+
var markers = addressPointsToMarkers(data)
56+
controls.markers.create(markers ,$scope.markers);
57+
$scope.markers = markers;
58+
});
59+
});
60+
}]);

examples/json/examples.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@
707707
"title": "Markercluster in a SemanticUI modal"
708708
},
709709
{
710-
"date": "2015-12-01T22:29:30.178Z",
710+
"date": "2016-06-24T19:43:02.545Z",
711711
"section": "markers",
712712
"onlyStandAlone": false,
713713
"id": "/markers/clustering-10000-markers-example-no-watch",

0 commit comments

Comments
 (0)