diff --git a/js/soundmap.add.js b/js/soundmap.add.js index 34c10f1..6415713 100644 --- a/js/soundmap.add.js +++ b/js/soundmap.add.js @@ -21,15 +21,24 @@ initMap: function(){ - this.map = L.map('map_canvas',{center: [this.origin.lat, this.origin.lng], zoom: this.origin.zoom}); - this.layers.push(new L.Google()); - this.layers.push(new L.Google('TERRAIN')); - this.map.addLayer(this.layers[0]); + //this.layers.push(new L.Google()); + //this.layers.push(new L.Google('TERRAIN')); + //this.map.addLayer(this.layers[0]); + /* L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={pk.eyJ1IjoibHJ1bGxvIiwiYSI6ImNpaDUydjdoNTAwd3BzdGx5bGlhOTh6bXYifQ.tE8QgNbVSgwP8V5LnJWA3w}', { + attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox', + maxZoom: 18, + id: 'mapbox.streets', + accessToken: 'your.mapbox.access.token' + }).addTo(this.map);*/ + mapboxUrl = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibHJ1bGxvIiwiYSI6ImNpaDUydjdoNTAwd3BzdGx5bGlhOTh6bXYifQ.tE8QgNbVSgwP8V5LnJWA3w'; + var grayscale = L.tileLayer(mapboxUrl, {id: 'mapbox.light'}), + streets = L.tileLayer(mapboxUrl, {id: 'mapbox.streets'}); + this.map = L.map('map_canvas',{center: [this.origin.lat, this.origin.lng], zoom: this.origin.zoom, layers: [grayscale,streets]}); this.map.addControl( new L.Control.Layers( { - 'Google':this.layers[0], - 'Google Terrain': this.layers[1] + 'Grayscale':grayscale, + 'Streets': streets }, {} ) ); @@ -42,7 +51,7 @@ this.map.panTo(_latlng); this.marker.addEventListener('dragend', this.markerDrag, this); } - _.bindAll(this); + //_.bindAll(this); this.initEvents(); ; @@ -106,4 +115,4 @@ soundmap.initMap(); }); -}(jQuery)); \ No newline at end of file +}(jQuery)); diff --git a/js/soundmap.config.js b/js/soundmap.config.js index 6e1b280..9568966 100644 --- a/js/soundmap.config.js +++ b/js/soundmap.config.js @@ -8,6 +8,7 @@ layers:{}, initMap: function(){ + /* this.map = L.map('map_canvas_options',{center: [this.origin.lat, this.origin.lng], zoom: this.origin.zoom}); this.layers.SATELLITE = new L.Google(); this.layers.TERRAIN = new L.Google('TERRAIN'); @@ -23,8 +24,21 @@ 'Google Roadmap': this.layers.ROADMAP }, {} ) + );*/ + mapboxUrl = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibHJ1bGxvIiwiYSI6ImNpaDUydjdoNTAwd3BzdGx5bGlhOTh6bXYifQ.tE8QgNbVSgwP8V5LnJWA3w'; + var grayscale = L.tileLayer(mapboxUrl, {id: 'mapbox.light'}), + streets = L.tileLayer(mapboxUrl, {id: 'mapbox.streets'}); + this.map = L.map('map_canvas_options',{center: [this.origin.lat, this.origin.lng], zoom: this.origin.zoom, layers: [grayscale,streets]}); + this.map.addControl( + new L.Control.Layers( + { + 'Grayscale':grayscale, + 'Streets': streets + }, {} + ) ); + this.map.addEventListener('dragend', this.mapDrag, this); this.map.addEventListener('zoomend', this.mapZoom, this); this.map.addEventListener('baselayerchange', this.layerChange, this); @@ -60,4 +74,4 @@ soundmap.initMap(); }); -}(jQuery)); \ No newline at end of file +}(jQuery));