Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- L.SLMarkers = L.Class.extend({
- initialize: function() {
- },
- onAdd: function (map) {
- this._map = map;
- this._initContainer();
- map.getPanes().mapPane.appendChild(this._el);
- this._setPosition();
- },
- onRemove: function(map) {
- map.getPanes().mapPane.removeChild(this._el);
- },
- _setPosition: function() {
- var pos = this._map.getCenter();
- L.DomUtil.setPosition(this._el, pos);
- },
- _initContainer: function() {
- var el = L.DomUtil.create('div', 'slmarker-cross');
- el.innerHTML = '<a href="#">X</a>';
- el.style.zIndex = 10000;
- el.style.width = 64;
- el.style.height = 64;
- el.style.position = "absolute";
- el.style.top = "50%";
- el.style.left = "50%";
- this._el = el;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement