blur-admin/src/app/pages/maps/leaflet/LeafletPageCtrl.js

31 lines
755 B
JavaScript

/**
* @author v.lugovsky
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.maps')
.controller('LeafletPageCtrl', LeafletPageCtrl);
/** @ngInject */
function LeafletPageCtrl($timeout) {
function initialize() {
var map = L.map(document.getElementById('leaflet-map')).setView([51.505, -0.09], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
L.marker([51.5, -0.09]).addTo(map)
.bindPopup('A pretty CSS3 popup.<br> Easily customizable.')
.openPopup();
}
$timeout(function(){
initialize();
}, 100);
}
})();