sim.mako 1.99 KB
Newer Older
Pierre Arnaud's avatar
Pierre Arnaud committed
1
2
3
4
5
6
7
8
## -*- coding: utf-8 -*-
<%!
import markdown
%>
<%inherit file="/site.mako"/>
<%def name="head()">
${parent.head()}
    <link rel="stylesheet" href="http://cdn.comarquage.fr/leaflet/latest/leaflet.css">
9
    <link rel="stylesheet" href="${request.static_path('passim:static/css/maps.css')}">
Pierre Arnaud's avatar
Pierre Arnaud committed
10
11
12
13
</%def>

${parent.page_header()}

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<p class="lead">${_(u'PASSIM : a map of multimodale info systems (MIS) in France')}</p>
<p>
  ${_("A MIS is an information service which includes at least the complete (multi-agency) public transport offer over a territory and a route planner.")}
  <br>
  ${_("This map is produced with data updated every day on")}
  <br>
  <a href="${request.host_url}/acces_donnees">${request.host_url}/acces_donnees</a>.
</p>

<div id="map"></div>

<script src="http://cdn.comarquage.fr/leaflet/latest/leaflet.js"></script>
<!--[if lt IE 9]>
    <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <script src="http://cdn.comarquage.fr/leaflet/latest/leaflet.ie.js"></script>
<![endif]-->

<script src="${request.static_path('passim:static/js/map.js')}"></script>
<script type='text/javascript'>
Pierre Arnaud's avatar
Pierre Arnaud committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
$(function () {
    // Configuration de la carte
    var map = new L.Map('map');

    // Configuration du support de la carte du zoom maximal et minimal
    var osmUrl="http://{s}.tile2.opencyclemap.org/transport/{z}/{x}/{y}.png";
    var osmAttrib=[
        'Données cartographiques CC-By-SA ',
        '<a href="http://openstreetmap.org/" rel="external">OpenStreetMap<\/a>, ',
        'Tuiles fournies par <a href="http://www.opencyclemap.org/" rel="external">Andy Allan<\/a>'
        ].join('');
    var osmLayer = new L.TileLayer(osmUrl, {minZoom: 2, maxZoom: 16, attribution: osmAttrib});

    // centrer la carte sur la France
    map.setView(new L.LatLng(46.5, 1.2), 6);
    map.addLayer(osmLayer);

    // ajout de la couche KML
    var simLayer = new L.KML();
52
    simLayer.addKML("${request.host_url}/donnees/kml/sim.kml");
Pierre Arnaud's avatar
Pierre Arnaud committed
53
54
55
56

    map.addLayer(simLayer);
    map.addLayer(osmLayer);
});
57
</script>