--- a/mouchak/static/js/editor.js +++ b/mouchak/static/js/editor.js @@ -313,7 +313,8 @@ else if(type === "map"){ var template = _.template($('#map-template').html()); $('#specific-content').html(template({ - tileLayer: this.model.get('tileLayer') + tileLayer: this.model.get('tileLayer'), + shp: this.model.get('shp') })); } }, --- a/mouchak/static/js/models.js +++ b/mouchak/static/js/models.js @@ -61,7 +61,8 @@ // Map model var Map = BaseType.extend({ defaults: _.extend(BaseType.prototype.defaults, { - tileLayer: "" + tileLayer:"", + shp: "" }), initialize: function(){ BaseType.prototype.initialize.call(this, arguments); --- a/mouchak/static/js/views.js +++ b/mouchak/static/js/views.js @@ -124,6 +124,11 @@ var restrictBounds = new L.LatLngBounds(southWest, northEast); M.map = new L.Map('map',{mapBounds: restrictBounds, zoom: 2, worldCopyJump: true, center:[14.604847155053898, 2.8125] }); L.tileLayer(this.model.get("tileLayer")).addTo(M.map); + if(this.model.has("shp")){ + $.getJSON(this.model.get("shp"), function(data){ + L.geoJSON(data); + }); + } } }); --- a/mouchak/templates/editor.html +++ b/mouchak/templates/editor.html @@ -204,6 +204,13 @@ m-data-target="tileLayer"> +
+
+ Shapefile + +
+
--- a/mouchak/templates/login.html +++ b/mouchak/templates/login.html @@ -13,7 +13,7 @@ - +