mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 23:53:15 +01:00
#8: prepare map
This commit is contained in:
parent
28ade2a8d9
commit
1dca83138a
6 changed files with 38 additions and 0 deletions
2
Gemfile
2
Gemfile
|
@ -35,6 +35,8 @@ gem 'elasticsearch-model'
|
||||||
gem 'elasticsearch-rails'
|
gem 'elasticsearch-rails'
|
||||||
gem 'elasticsearch-dsl'
|
gem 'elasticsearch-dsl'
|
||||||
|
|
||||||
|
gem 'leaflet-rails'
|
||||||
|
|
||||||
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
|
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
|
||||||
|
|
||||||
# bundle exec rake doc:rails generates the API under doc/api.
|
# bundle exec rake doc:rails generates the API under doc/api.
|
||||||
|
|
|
@ -127,6 +127,8 @@ GEM
|
||||||
rails
|
rails
|
||||||
launchy (2.4.3)
|
launchy (2.4.3)
|
||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
|
leaflet-rails (1.3.1)
|
||||||
|
rails (>= 4.2.0)
|
||||||
loofah (2.2.2)
|
loofah (2.2.2)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
|
@ -292,6 +294,7 @@ DEPENDENCIES
|
||||||
kaminari
|
kaminari
|
||||||
kaminari-i18n
|
kaminari-i18n
|
||||||
launchy
|
launchy
|
||||||
|
leaflet-rails
|
||||||
omniauth
|
omniauth
|
||||||
omniauth-browserid
|
omniauth-browserid
|
||||||
pry
|
pry
|
||||||
|
|
6
app/controllers/geo_controller.rb
Normal file
6
app/controllers/geo_controller.rb
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
class GeoController < ApplicationController
|
||||||
|
|
||||||
|
def index
|
||||||
|
render action: "index"
|
||||||
|
end
|
||||||
|
end
|
25
app/views/geo/index.html.slim
Normal file
25
app/views/geo/index.html.slim
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
doctype html
|
||||||
|
html
|
||||||
|
head
|
||||||
|
title Stadtratmonitor Leipzig - Karte
|
||||||
|
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
|
||||||
|
= stylesheet_link_tag 'https://unpkg.com/leaflet@1.0.1/dist/leaflet.css'
|
||||||
|
= javascript_include_tag 'vendor/modernizr'
|
||||||
|
= javascript_include_tag 'https://unpkg.com/leaflet@1.0.1/dist/leaflet.js'
|
||||||
|
= csrf_meta_tags
|
||||||
|
|
||||||
|
body
|
||||||
|
.row
|
||||||
|
.small-12.columns
|
||||||
|
.clearfix
|
||||||
|
h3#title = 'Karte'
|
||||||
|
div#map/
|
||||||
|
javascript:
|
||||||
|
var map = L.map('map').setView([51.4437366804, 11.865234375], 9);
|
||||||
|
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
|
{
|
||||||
|
attribution: 'Map data @ <a href="http://openstreetmap.org">OpenStreetMap</a> contributors</a>',
|
||||||
|
maxZoom: 12,
|
||||||
|
minZoom: 8
|
||||||
|
}
|
||||||
|
).addTo(map);
|
|
@ -25,6 +25,7 @@ html
|
||||||
h1[id="title" class="left"] = link_to 'Stadtratmonitor Leipzig', search_path
|
h1[id="title" class="left"] = link_to 'Stadtratmonitor Leipzig', search_path
|
||||||
div(class="right")
|
div(class="right")
|
||||||
div(class="left") = link_to_unless_current 'Suche', search_path
|
div(class="left") = link_to_unless_current 'Suche', search_path
|
||||||
|
div(class="left header_indent") = link_to_unless_current 'Karte', geo_path
|
||||||
div(class="left header_indent") = link_to_unless_current 'Glossar', glossary_url
|
div(class="left header_indent") = link_to_unless_current 'Glossar', glossary_url
|
||||||
div(class="right header_indent") = link_to_unless_current 'Impressum', impressum_url
|
div(class="right header_indent") = link_to_unless_current 'Impressum', impressum_url
|
||||||
div(class="clear")
|
div(class="clear")
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
root :to => 'search#index', as: :search
|
root :to => 'search#index', as: :search
|
||||||
post '/import' => 'import#new_papers_callback'
|
post '/import' => 'import#new_papers_callback'
|
||||||
|
get '/map' => 'geo#index', as: :geo
|
||||||
get '/glossary' => 'application#glossary', as: :glossary
|
get '/glossary' => 'application#glossary', as: :glossary
|
||||||
get '/impressum' => 'application#impressum', as: :impressum
|
get '/impressum' => 'application#impressum', as: :impressum
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue