Commit 6c3ebda6 authored by Klaus Stein's avatar Klaus Stein
Browse files

Add an overview map of the UMM cities

parent cd08510c
class OverviewController < ApplicationController
def index
end
def umm
end
end
......@@ -19,8 +19,8 @@ import 'leaflet-distortableimage/dist/leaflet.distortableimage.css'
import '../leaflet-plugins/leaflet-providers'
import "../src/overview-map"
import "../src/umm-map"
import "../src/example-map"
import "../src/place-map"
import "../src/imagemap-map"
......
import L from 'leaflet';
import 'leaflet-defaulticon-compatibility';
document.addEventListener("turbolinks:load", function(event) {
const mapdiv = document.getElementById('umm-map');
if(!mapdiv) return; // Hm, wrong page?
const europe_url = mapdiv.dataset.europeUrl;
const cities_url = mapdiv.dataset.citiesUrl;
const map = L.map(mapdiv,
{
center: [49.9, 10.9],
zoom: 5.5,
zoomSnap: 0.25,
zoomDelta: 0.25
});
function addEurope(data) {
L.geoJSON(data, {
style: () => { return {
weight: 1,
color: '#666',
fillColor: 'black',
fillOpacity: 0.8
};}
}).addTo(map).bringToBack();
}
function addCities(data) {
L.geoJSON(data, {
style: () => { return {
opacity: 1,
fillOpacity: 1
}; },
pointToLayer: (pt, latlng) => L.circleMarker(latlng, {
color: 'black',
opacity: 1,
weight:1,
fillColor: 'gold',
fillOpacity: 1,
radius: 4
})
}).addTo(map).bringToFront();
}
fetch(europe_url).then(r => r.json()).then(addEurope).then(fetch(cities_url).then(r => r.json()).then(addCities));
});
......@@ -85,3 +85,10 @@
}
}
}
#umm-map {
width:100%;
height:100%;
box-sizing: border-box;
background: white;
}
<% content_for(:cssclass) { "borderless" } %>
<div id="umm-map"
data-europe-url="<%= root_path + 'geojson/europe.geojson' %>"
data-cities-url="<%= root_path + 'geojson/umm-cities.geojson' %>"
></div>
......@@ -11,6 +11,7 @@ Rails.application.routes.draw do
root 'overview#index'
get 'overview/index'
get 'overview/umm'
resources :localized_names
resources :places do
resources :image_maps, only: :index
......
This diff is collapsed.
{
"features": [
{
"geometry": {
"coordinates": [
11.085205078125,
49.453842594330716
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
7.84423828125,
47.99727386804474
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
9.99755859375,
53.55988897245464
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
9.73388671875,
52.3755991766591
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
12.392578125,
51.33061163769853
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
7.00927734375,
51.46085244645549
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
6.75933837890625,
51.44716034698012
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
13.265991210937498,
53.55988897245464
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
14.337158203125,
51.767839887322154
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
17.02880859375,
51.12421275782688
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
14.5458984375,
53.4357192066942
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
16.36962890625,
48.21003212234042
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
16.24053955078125,
47.81684332352077
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
9.16259765625,
48.777912755501845
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
6.9598388671875,
50.941123218673084
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
16.94091796875,
52.40912125231122
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
12.9254150390625,
50.83716687845952
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
14.2822265625,
48.32703913063476
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
14.414062499999998,
48.04136507445029
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
13.040771484374998,
47.79839667295524
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
11.392822265624998,
47.264320080254805
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
15.441284179687498,
47.07386310181414
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
13.8482666015625,
46.619261036171515
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
26.103515625,
44.43377984606822
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
25.6146240234375,
45.65244828675087
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
26.021118164062496,
44.94536144236941
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
28.828124999999996,
47.02895043138593
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
15.57861328125,
54.18172660239092
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
17.4737548828125,
50.86144411058924
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
19.412841796875,
54.16886584596351
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
22.35546112060547,
49.860120025995734
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
19.22161102294922,
52.47253393751
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
23.6865234375,
52.10313118589299
],
"type": "Point"
},
"properties": {
"marker-symbol": "",
"marker-size": "medium",
"marker-color": "#ff0000"
},
"type": "Feature"
}
],
"type": "FeatureCollection"
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment