Commit 8c2ed2e639a3088e661ce5226bc17fbe277821bc

  • avatar
  • arvind
  • Fri Oct 04 13:04:24 IST 2013
Feature completions
        - Adding an option to specify shapefiles in geoJSON format
        - login.html uses the new bootstrap file now
  • Diff rendering mode:
  • inline
  • side by side

mouchak/static/js/editor.js

313 else if(type === "map"){313 else if(type === "map"){
314 var template = _.template($('#map-template').html());314 var template = _.template($('#map-template').html());
315 $('#specific-content').html(template({315 $('#specific-content').html(template({
316 tileLayer: this.model.get('tileLayer')
316 tileLayer: this.model.get('tileLayer'),
317 shp: this.model.get('shp')
317 }));318 }));
318 }319 }
319 },320 },

mouchak/static/js/models.js

61 // Map model61 // Map model
62 var Map = BaseType.extend({62 var Map = BaseType.extend({
63 defaults: _.extend(BaseType.prototype.defaults, {63 defaults: _.extend(BaseType.prototype.defaults, {
64 tileLayer: ""
64 tileLayer:"",
65 shp: ""
65 }),66 }),
66 initialize: function(){67 initialize: function(){
67 BaseType.prototype.initialize.call(this, arguments);68 BaseType.prototype.initialize.call(this, arguments);

mouchak/static/js/views.js

124 var restrictBounds = new L.LatLngBounds(southWest, northEast);124 var restrictBounds = new L.LatLngBounds(southWest, northEast);
125 M.map = new L.Map('map',{mapBounds: restrictBounds, zoom: 2, worldCopyJump: true, center:[14.604847155053898, 2.8125] });125 M.map = new L.Map('map',{mapBounds: restrictBounds, zoom: 2, worldCopyJump: true, center:[14.604847155053898, 2.8125] });
126 L.tileLayer(this.model.get("tileLayer")).addTo(M.map);126 L.tileLayer(this.model.get("tileLayer")).addTo(M.map);
127 if(this.model.has("shp")){
128 $.getJSON(this.model.get("shp"), function(data){
129 L.geoJSON(data);
130 });
131 }
127 }132 }
128 });133 });
129134

mouchak/templates/editor.html

204 m-data-target="tileLayer">204 m-data-target="tileLayer">
205 </div>205 </div>
206 </div>206 </div>
207 <div class="form-group">
208 <div class="input-group">
209 <span class="input-group-addon"><strong>Shapefile</strong></span>
210 <input class="form-control" type="text" placeholder="" value="<%= shp %>"
211 m-data-target="shp">
212 </div>
213 </div>
207 <div class="preview"></div>214 <div class="preview"></div>
208 </div>215 </div>
209 </script>216 </script>

mouchak/templates/login.html

13 <!-- Place favicon.ico in the root directory -->13 <!-- Place favicon.ico in the root directory -->
1414
15 <link rel="stylesheet" href="{{url_for('static', filename='css/normalize.css')}}">15 <link rel="stylesheet" href="{{url_for('static', filename='css/normalize.css')}}">
16 <link rel="stylesheet" href="{{url_for('static', filename='css/bootstrap.css')}}">
16 <link rel="stylesheet" href="{{url_for('static', filename='css/bootstrap.min.css')}}">
17 <style type="text/css">17 <style type="text/css">
18 .form-wrapper {18 .form-wrapper {
19 height: 300px;19 height: 300px;