#8: prepare map

This commit is contained in:
Joerg Reichert 2018-03-31 20:50:38 +02:00
parent 28ade2a8d9
commit 1dca83138a
6 changed files with 38 additions and 0 deletions

View file

@ -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.

View file

@ -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

View file

@ -0,0 +1,6 @@
class GeoController < ApplicationController
def index
render action: "index"
end
end

View 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 &#64; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors</a>',
maxZoom: 12,
minZoom: 8
}
).addTo(map);

View file

@ -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")

View file

@ -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