Create multipoint by clicking on input-button using Dojo/on and Dojo/dom

المشرف العام

Administrator
طاقم الإدارة
I'm new to this site and javascript/dojo, and need some debugging help.

I want the user to be able to click on a button wich initialize a function that draws multipoint using esri.toolbars.draw. I don't get any error message in firefox debugging console or firebug.

The button ID, Div ID, and button class are all named: btn_1

Here's the code:

var map, markerSymbol, tb;require(["esri/map", "esri/arcgis/utils", "esri/layers/GraphicsLayer", "esri/layers/FeatureLayer", "dojo/_base/array", "dojo/parser", "esri/dijit/Legend", "esri/symbols/PictureMarkerSymbol", "esri/graphic", "esri/Color", "esri/InfoTemplate","esri/geometry/Point", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/layout/AccordionContainer","dojo/_base/xhr", "esri/dijit/Scalebar", "esri/geometry/Polyline", "esri/dijit/HomeButton", "esri/dijit/LocateButton", "esri/dijit/InfoWindow","esri/SpatialReference", "esri/symbols/SimpleLineSymbol", "esri/toolbars/draw", "dojo/on", "dojo/dom", "dojo/query", "esri/symbols/SimpleMarkerSymbol", "dojo/domReady!"], function(Map, arcgisUtils, GraphicsLayer, FeatureLayer, Legend, Dojo, Parser, PictureMarkerSymbol, Graphic, Color,InfoTemplate, Point, BorderContainer, ContentPane, AccordionContainer, xhr, Scalebar, Polyline, HomeButton, LocateButton, InfoWindow, SpatialReference, SimpleLineSymbol, Draw, on, dom, query, SimpleMarkerSymbol) {map = new esri.Map("mapDiv", {basemap:"topo",center: [17.818398,60.214609,], zoom: 9,basemap: "streets"});

map.on("load", initToolbar); //Metodanrop till draw toolbar var markerSymbol = new esri.symbol.SimpleMarkerSymbol(); markerSymbol.setPath("M16,4.938c-7.732,0-14,4.701-14,10.5c0,1.981,0.741,3.833,2.016,5.414L2,25.272l5.613-1.44c2.339,1.316,5.237,2.106,8.387,2.106c7.732,0,14-4.701,14-10.5S23.732,4.938,16,4.938zM16.868,21.375h-1.969v-1.889h1.969V21.375zM16.772,18.094h-1.777l-0.176-8.083h2.113L16.772,18.094z"); markerSymbol.setColor(new Color("#00FFFF")); var scalebar = new esri.dijit.Scalebar({ //Kod f

أكثر...
 
أعلى