Mercurial > pub > ImplabJs
changeset 15:b85df31b7e0e
Разработка кнопки выбора координат с карт
author | nickolay |
---|---|
date | Mon, 18 Sep 2017 21:59:41 +0300 |
parents | 5fd2a35d65c0 |
children | 1eeae195b234 |
files | src/djol/CoordPickerTool.js |
diffstat | 1 files changed, 24 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/djol/CoordPickerTool.js Mon Sep 18 21:59:41 2017 +0300 @@ -0,0 +1,24 @@ +define (["dojo/_base/declare", "./_OneshotTool", "implab/safe", "dojo/when"] , function(declare, _OneshotTool, safe, when) { + return declare([_OneshotTool], { + _map : null, + _proj : null, + + constructor : function(opts) { + safe.argumentNotNull(opts && opts.map, "opts.map"); + + this._map = opts.map; + this._proj = opts.proj; + }, + + invoke : function() { + var me = this; + + return when(me.awaitMapEvent('singleclick'), function(evt){ + if (me._proj) { + // тут можно преобразовать проекции + } + return evt; + }); + } + }); +}); \ No newline at end of file