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 $(document).ready(function () {
20 if (!$('#tile-map').length) {
23 console.log('Initializing map');
25 var longitude = Number(
26 $('#tile-map #gps-longitude').val());
27 var latitude = Number(
28 $('#tile-map #gps-latitude').val());
30 // Get a new map instance attached and element with id="tile-map"
31 var map = new L.Map('tile-map');
33 var mqtileUrl = 'http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.jpg';
34 var mqtileAttrib = '<a id="osm_license_link">see map license</a>';
35 var mqtile = new L.TileLayer(
38 attribution: mqtileAttrib,
41 map.attributionControl.setPrefix('');
42 var location = new L.LatLng(latitude, longitude);
43 map.setView(location, 13).addLayer(mqtile);
45 var marker = new L.Marker(location);