Skip to content

Commit

Permalink
fix front page map for new LEL version (#1266)
Browse files Browse the repository at this point in the history
* fix front page map for new LEL version

* Update routes.rb

* Update routes.rb

* Update routes.rb
  • Loading branch information
jywarren authored Apr 21, 2020
1 parent bc2be71 commit cb9eb11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 42 deletions.
45 changes: 3 additions & 42 deletions app/views/front_ui/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
var Mapknitterunique = L.map('mapknitter-unique').setView([places[0].lat, places[0].lng], 8);
var hash = new L.Hash(Mapknitterunique);

var MapKnitter = L.layerGroup.mapKnitterLayer().addTo(Mapknitterunique);
L.LayerGroup.EnvironmentalLayers({include: ['mapknitter']}).addTo(Mapknitterunique);

function displayFeaturedPlaces() {
shuffleArray(places);
Expand Down Expand Up @@ -236,7 +236,7 @@
var token = "pk.eyJ1Ijoianl3YXJyZW4iLCJhIjoiVzVZcGg3NCJ9.BJ6ArUPuTs1JT9Ssu3K8ig";
var baselayer = L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/outdoors-v11/tiles/{z}/{x}/{y}?access_token=' + token, {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(Mapknitterunique);
}).addTo(Mapknitterunique);

// Mapknitterunique.addControl(new L.Control.Fullscreen()); // to go full-screen
Mapknitterunique.on('fullscreenchange', function () {
Expand All @@ -248,43 +248,4 @@
}
});


var baseMaps = {
"Baselayer1": baselayer
};
var overlayMaps = {
// "PurpleAirLayer-Markers": PurpleAirMarkerLayer ,
// "SkyTruth": SkyTruth ,
// "Fractracker" : Fractracker ,
// "ToxicRelease": ToxicRelease ,
// "OdorReport": OdorReport ,
"MapKnitter": MapKnitter ,
// "OpenInfraMap_Power": OpenInfraMap_Power ,
// "OpenInfraMap_Telecom": OpenInfraMap_Telecom ,
// "OpenInfraMap_Petroleum": OpenInfraMap_Petroleum ,
// "OpenInfraMap_Water": OpenInfraMap_Water ,
// "Justicemap_income": Justicemap_income,
// "JusticeMap_americanIndian": JusticeMap_americanIndian ,
// "JusticeMap_asian": JusticeMap_asian ,
// "JusticeMap_black": JusticeMap_black,
// "JusticeMap_multi": JusticeMap_multi ,
// "JusticeMap_hispanic": JusticeMap_hispanic ,
// "JusticeMap_nonWhite": JusticeMap_nonWhite,
// "JusticeMap_white": JusticeMap_white ,
// "JusticeMap_plurality": JusticeMap_plurality ,
// "Clouds": clouds ,
// "clouds (classic)": cloudscls ,
// "precipitation": precipitation ,
// "precipitation (classic)": precipitationcls ,
// "rain": rain ,
// "rain (classic)": raincls ,
// "snow": snow ,
// "pressure": pressure ,
// "pressure contour (zoom in)": pressurecntr ,
// "temp": temp ,
// "wind": wind ,
// "Cities (zoom in)": city ,
// "windrose (zoom in)": windrose
};
L.control.layers(baseMaps, overlayMaps).addTo(Mapknitterunique);
</script>
</script>
5 changes: 5 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
end
end

# preserve legacy API alias for https://github.com/publiclab/leaflet-environmental-layers/
namespace 'map' do
get 'region', action: :region
end

namespace 'maps' do
%w(map featured region license).each do |action|
get action, action: action
Expand Down

0 comments on commit cb9eb11

Please sign in to comment.