2 # GNU MediaGoblin -- federated, autonomous media hosting
3 # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Affero General Public License for more details.
15 # You should have received a copy of the GNU Affero General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 {% block geolocation_map %}
21 and model.get_location.position
22 and "latitude" in model.get_location.position
23 and "longitude" in model.get_location.position %}
25 {%- set lon = model.get_location.position.longitude %}
26 {%- set lat = model.get_location.position.latitude %}
27 {%- set osm_url = "http://openstreetmap.org/?mlat={lat}&mlon={lon}".format(lat=lat, lon=lon) %}
28 <div id="tile-map" style="width: 100%; height: 196px;">
29 <input type="hidden" id="gps-longitude"
31 <input type="hidden" id="gps-latitude"
34 <script> <!-- pop up full OSM license when clicked -->
35 $(document).ready(function(){
36 $("#osm_license_link").click(function () {
37 $("#osm_attrib").slideToggle("slow");
41 <div id="osm_attrib" class="hidden"><ul><li>
43 href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>
45 </li><li>Imaging ©<a
46 href="http://mapquest.com">MapQuest</a></li><li>Maps powered by
47 <a href="http://leafletjs.com/"> Leaflet</a></li></ul>
52 View on <a href="{{ osm_url }}">OpenStreetMap</a>