0
嗨我在我的應用程序中使用emberjs和mapbox.js,並根據mapboxjs它會自動顯示地圖,並一旦我的頁面加載在地圖上[疊加] [複選框]使用EmberJS捕獲動態生成的複選框checked事件
App.FullMap = Ember.View.extend({
/**
* Public construction properties
*/
vehicles: [],
/**
* Private properties & methods
*/
_vmarkers: [],
classNames: ['map full-map'],
didInsertElement: function() {
this.map = L.map(this.get('element'), {
minZoom: 4,
maxZoom: 16,
attributionControl: false,
worldCopyJump: true
});
this.set('controller.map', this.map);
var overlays = [];
overlays['2 wheelers'] = {name:"2 wheelers"};
overlays['3 wheelers'] = {name:"3 wheelers"};
overlays['4 wheelers'] = {name:"4 wheelers"};
overlays['Heavy Load'] = {name:"Heavy Load"};
// Build the layer control
_.maps.layerControl(this.map, 'topleft', {
normal: true,
satellite: true
}, overlays);
$('.leaflet-map-pane').addClass('normal-view');
this.createMarkers();
});
在HBS加載該視圖中mapbox如下
<div class="leaflet-control-layers-overlays">
<label><input type="checkbox" class="leaflet-control-layers-selector<span> 2 wheelers</span></label>
<label><input type="checkbox" class="leaflet-control-layers-selector"><span> 3 wheelers</span></label>
<label><input type="checkbox" class="leaflet-control-layers-selector"><span> 4 wheelers</span></label>
<label><input type="checkbox" class="leaflet-control-layers-selector"><span> Heavy Load</span></label>
</div>
現在將autoamtically genrate這些複選框疊加後我的問題是如何訪問使用燼複選框財產,因爲複選框會自動呈現b y添加了地圖BoxJS的疊加層,並且我將如何檢查複選框。 基於複選框事件我要地圖
上顯示標記列表請幫我打電話給基礎上的複選框事件
this.createMarkers();
太謝謝你了。 – 2014-11-14 06:24:16