POST
|
How do I display a image directly on my map? I would like to place my logo above the Scalebar widget. I assume you need to make an off-panel widget, so I was looking at the other off panel widgets. I noticed the way the coordinate widget displays itself is in the postCreate function: postCreate: function() { this.inherited(arguments); domClass.add(this.coordinateBackground, "coordinate-background"); this.own(on(this.map, "extent-change", lang.hitch(this, this.onExtentChange))); this.own(on(this.map, "mouse-move", lang.hitch(this, this.onMouseMove))); this.own(on(this.map, "click", lang.hitch(this, this.onMapClick))); this.own(on(this.locateButton, "click", lang.hitch(this, this.onLocateButtonClick))); this.own(on(this.foldContainer, 'click', lang.hitch(this, this.onFoldContainerClick))); this.graphicsLayer = new GraphicsLayer(); this.map.addLayer(this.graphicsLayer); } They appear to be using either domClass.add or a GraphicsLayer. Where can i find more information about these Objects? Esri's GraphicLayer API documentation doesn't mention the addLayer that is used in this widget, and the domClass.add seems to be depreciated.
... View more
10-01-2018
02:15 PM
|
0
|
1
|
351
|
POST
|
Hi Robert, I changed "landLayer.setInfoTemplates({ infoTemplates });" to "landLayer.setInfoTemplates({ 1: { infoTemplate: infoTemplates } });", but nothing is appearing. sideNote: why is the syntax for this line include 1: ?? I've never seen anything like that.
... View more
08-30-2017
08:59 AM
|
0
|
1
|
607
|
POST
|
Hi all, I am trying to add a popup to an ArcGISDynamicMapLayer, and I am a little stuck. I can't get the popups to appear, but I'm not getting any errors in the console. I think the error might be when I try to add the intoTemplate to the layer, but I'm not sure. Here is my code: (I've edited it out extra widgets so it is shorter, but I left the requires and declarations) require([ "esri/map", "esri/arcgis/utils", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/dijit/LayerList", "esri/dijit/BasemapGallery", "esri/dijit/Popup", "esri/dijit/PopupTemplate", "dojo/parser", "dojo/dom-construct", "dojo/on", "esri/InfoTemplate", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojox/layout/ExpandoPane", "dojo/domReady!" ], function (Map, arcgisUtils, ArcGISDynamicMapServiceLayer, LayerList, BasemapGallery, Popup, PopupTemplate, parser, domConstruct, on, InfoTemplate) { var popup = new Popup({}, domConstruct.create("div")); var map = new Map("map", { basemap: "topo", center: [-98.40, 29.67], //centers on san antonio zoom: 11, //zooms to all of bexar county, must be integer infoWindow: popup }); BCADParcelPopup = new InfoTemplate("2016 BCAD Parcels", ""); var infoTemplates = { infoTemplate: BCADParcelPopup, layerUrl: url + "/40" //sudocode, i actually have the url as a string here. }; var landLayer = new ArcGISDynamicMapServiceLayer( url, { "id": "Land" }); landLayer.setImageFormat("png32"); landLayer.setInfoTemplates({ infoTemplates }); map.addLayer(landLayer); });
... View more
08-30-2017
08:12 AM
|
0
|
3
|
849
|
POST
|
ok, I get it, i think. All of the requires with a corresponding variable have to be first, followed the the requires that don't have a variable? do the requires with a variable need to be in any specific order(as long as they stay synced up)?
... View more
08-25-2017
07:26 AM
|
0
|
1
|
1397
|
POST
|
Hi again. I am trying to wait for the load event on the widget and the manipulate the layers array. I seem to be doing something wrong, as i get a browser error saying "TypeError: c is null". The problem seems to be with my on("load") statement, but all of the examples I have seen seem to do it similarly. I checked, and my require "dojo/on" and the function order is the same, and I've called the on("load") function after I have declared the LayerList. Is there a step i am missing somewhere? Here is my code: require([ "esri/map", "esri/arcgis/utils", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/dijit/LayerList", "esri/dijit/BasemapGallery", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/parser", "dojo/on", "dojo/domReady!" ], function (Map, arcgisUtils, ArcGISDynamicMapServiceLayer, LayerList, BasemapGallery, parser, on) { ...declaring layers and map object..... //layerlist widget initialization var layerListWidget = new LayerList({ map: map, }, "layerList"); layerListWidget.startup(); on(layerListWidget, "load", function (item) { item.layers.reverse(); item.layers.pop(); item.layers.reverse(); });
... View more
08-25-2017
06:58 AM
|
0
|
3
|
1397
|
POST
|
So I have another question: how do i remove a layer from the layerList? I noticed that one of the layers added is the basemap, and I don't want users to be able to toggle it on and off. I didnt see a remove function, so do I have to instead define all of the layers that I want in the list and omit the basemap Layer?
... View more
08-24-2017
10:04 AM
|
0
|
5
|
1397
|
POST
|
Thank you Robert. I don't know how I missed this tidbit, but thanks
... View more
08-24-2017
09:07 AM
|
0
|
0
|
1397
|
POST
|
Hi all, I would like to add multiple layers to the LayerList dijit (using 3.21). I tried to add each layer to an array as it was added to the map and then reference the array when making the LayerList, but this left out all of the sublayers. here is my code: var layerArray = new Array(); var tempLayer = new ArcGISDynamicMapServiceLayer( "https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer"); layerArray.push(map.addLayer(tempLayer)); .....repeated with different layers....... //layerlist widget initialization var layerListWidget = new LayerList({ map: map, layers: layerArray }, "layerList"); layerListWidget.startup(); Is there a way to add all of the layers (and sublayers) to the layerList Dijit programmatically?
... View more
08-24-2017
07:26 AM
|
0
|
8
|
2006
|
POST
|
Thank you very much sir, I would have never figured all this out on my own. Is there a resource that shows when ESRI is going to update the 4x API? I've seen the functionality matrix, but it is pretty vauge on when some fixes are expected to happen.
... View more
08-23-2017
09:01 AM
|
0
|
1
|
699
|
POST
|
require([ "esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "dojo/domReady!" ], function (Map, ArcGISDynamicMapServiceLayer) { var map = new Map("map", { basemap: "topo", center: [-98.493629, 29.424122], //centers on san antonio zoom: 10 //zooms to all of bexar county, must be integer }); var tempLayer = new ArcGISDynamicMapServiceLayer(url); tempLayer.setImageFormat("png32"); map.addLayer(tempLayer); console.log(tempLayer.id); }); The url I am using in the tempLayer requires a login/password to access, and I can't give that out. Is my code correct otherwise? If it is, then maybe the problem is how the layer is set up on my ArcGIS server? I didn't have this problem in 4.4, so maybe there is a difference in what 4.4 and 3.21 need the ArcGIS server settings to be?
... View more
08-23-2017
08:31 AM
|
0
|
3
|
699
|
POST
|
Thanks Robert! Small problem: My layer is now transparent like it should be, but it is only picking up one sublayer. I had thought my opaque shape was covering all of the other sublayers, but now I see that only the one sublayer is being drawn. Is there a way to get the computer to draw all of the layers without me defining every sublayer in the code?
... View more
08-23-2017
07:59 AM
|
0
|
5
|
699
|
POST
|
Hi all, I've recently had to switch from writing code in the javascript 4.4 API to the 3.21 API because of the lack toolbar functionality. This means rewriting my code. When I was working with the 4.4, I could call a Map Service by using MapImageLayer. In 3.21, I use ArcGISDynamicMapServiceLayer. However, in 3.21, my layers are completely opaque. This wasn't a problem in 4.4, as MapImageLayer would show the layer the same way it had been published. How do I get the layers to look the same as when they were published?
... View more
08-23-2017
07:05 AM
|
0
|
7
|
816
|
POST
|
Thanks a bunch Thomas, i uhhhh never thought to check the css style haha.
... View more
08-22-2017
09:12 AM
|
0
|
0
|
429
|
POST
|
Hi all, I am putting several widgets in my mapView. Everything works fine, but I have noticed there is a gap in-between the widgets that I didn't define. Is there a way to change how big the space is? Here is the code I am using, nothing fancy: //LayerListWidget initialization var layerList = new LayerList({ view: view, }); view.ui.add(layerList, "top-right"); //initialization of the basemapGallery widget var basemapGallery = new BasemapGallery({ view: view, }); view.ui.add(basemapGallery, { position: "top-right" }); //initializing the Scale Bar widget var scaleBar = new ScaleBar({ view: view, unit: "non-metric" }); view.ui.add(scaleBar, { position: "top-right" });
... View more
08-22-2017
08:24 AM
|
0
|
2
|
549
|
POST
|
Howdy all! I have been practicing with the BasemapGallery widget. I wanted to make a button that destroys or creates the widget, so i could "hide" and "show" the widget. The BasemapGallery is pretty big, screen space wise, so I just want a way to get it out of the way when it isn't needed. I did this by creating a <div> element, then assigning the "hide" button and the widget to it. In my code, all the button does is destroy the widget (I'll figure out how to bring it back later). However, when I click the button, both the widget and the button get destroyed. Why is my basemapGallery.destroy() command so bloodthirsty? Below is the code I have: //initialization of the basemapGallery widget var basemapDom = domConstruct.toDom("<div id='divContainer'></div>"); var basemapGallery = new BasemapGallery({ view: view, container: basemapDom }); //BasemapGallery hide button is being defined watchUtils.whenDefinedOnce(basemapGallery, "viewModel", function (evt) { //trying to create a div element and place the button and widgit inside of it var buttonDom = domConstruct.create("button", { class: 'basemapGallery', type: 'button', innerHTML: 'Basemaps'}, basemapDom, "first"); on(buttonDom, 'click', function () { basemapGallery.destroy(); }); }); view.ui.add(basemapDom, { position: "top-right" }); Thanks for taking a look at this
... View more
08-21-2017
02:07 PM
|
0
|
4
|
1559
|
Title | Kudos | Posted |
---|---|---|
1 | 08-17-2017 02:04 PM | |
1 | 08-10-2017 06:43 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|