javascript - Leaflet map not showing up in Backbone -


here's view:

define([     'jquery',     'underscore',     'backbone',     'bootstrap',     'leaflet',     'text!templates/map/maptemplate.html' ], function($, _, backbone, bootstrap, l, maptemplate){      var mapview = backbone.view.extend({         el: '.body',         template: _.template(maptemplate),         render: function() {              // load map template             this.$el.html(this.template());              // create map             var map = l.map('map', {                 dragging: false             });              l.tilelayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addto(map);              map.locate({setview: true, maxzoom: 15});              function onlocationfound(e) {                 var radius = e.accuracy / 2;                  l.marker(e.latlng).addto(map);                  l.circle(e.latlng, radius).addto(map);             }              map.on('locationfound', onlocationfound);              function onlocationerror(e) {                 alert(e.message);             }              map.on('locationerror', onlocationerror);         }     });      return mapview; }); 

and underscore template has div in id of map. i'm not getting errors in console, , when check requests, it's downloading of tiles , everything, none of them getting rendered. thoughts on this?


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -