ArcGIS API for JavaScript在地图上添加一个标注图标

来源:互联网 发布:数据库基础知识题库 编辑:程序博客网 时间:2024/06/15 01:17
        _addAddress: function () {  //添加热点地址
            this.curNavToolbar.deactivate();
            this._draw.deactivate();
            this._graphiclayer.clear();
            this.cmap.graphics.clear();
            this.cmap.setMapCursor("pointer");
            this._draw.activate(Draw.POINT);
            this._draw.on("draw-end", function (evt) {
                this._hotCanMove = true;
                this.cmap.setMapCursor("default");
                this._draw.deactivate();
                this._point = evt.geometry;
                var marksymbol = new esri.symbol.PictureMarkerSymbol("/images/position.png", 20, 24).setOffset(0, 11);
                this._graphic = new Graphic(evt.geometry, marksymbol);
                this._graphiclayer.clear();
                this._graphiclayer.add(this._graphic);
                this.cmap.addLayer(this._graphiclayer);
                this._graphiclayer.on("mouse-down", function (evt) {
                    if (this._hotCanMove) {
                        this._isMouseDown = true;
                        this.cmap.disableMapNavigation();
                    }
                }.bind(this));
0 0
原创粉丝点击