I have the following service loaded into my map:
http://gis.fema.gov/REST/services/FEMA/LSR/MapServer
I would like to be able to sample the graphics from this service in a popup as if it is loaded into an AGOL Webmap. Unless I'm confused, the above link is to a Map Service and not Feature Layer. However, when I inspect the layers, they area labeled as Feature Layers. I read somewhere that you cannot query a Map Service for features. So I'm confused. Can I query this layer to be able to display ALL attributes in a popup? If so, how?
Thanks in advance
Hi Charles
u can try this esri sample, with few editing, u should be able to query any layer in your map service..
here u are:
Feature layer hover | ArcGIS API for JavaScript
From your service directory, your layers supports the "Query" REST function.
I appreciate the response. I tried incorporating the code and the console prints out:
TooltipDialog in not a constructor
I have all the following in the require and function calls, exactly as it is in the example. I do have many other requires, however I'm fairly certain that I have the order consistent because the page loads fine. Typically if the order is out, the page bombs on load.
require([
"esri/map", "esri/layers/FeatureLayer",
"esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol",
"esri/renderers/SimpleRenderer", "esri/graphic", "esri/lang",
"esri/Color", "dojo/number", "dojo/dom-style",
"dijit/TooltipDialog", "dijit/popup", "dojo/domReady!"
], function(
Map, FeatureLayer,
SimpleFillSymbol, SimpleLineSymbol,
SimpleRenderer, Graphic, esriLang,
Color, number, domStyle,
TooltipDialog, dijitPopup
) {
It is hard to guess what else you are trying to load in the "require" section, but according to your description, it seems that it is a packaging issue. Make sure that the paths you add - like "someFolder/someJavascriptModule"- is mapped to a physical resource in your web application.
Feel free to share the code..
require(["esri/map","esri/geometry/webMercatorUtils","esri/dijit/BasemapToggle","dojo/_base/connect","dijit/form/Button", | ||
"dojo/dom","dojo/parser","dojo/ready","dojo/on", "dojo/_base/Color","dojo/keys", "dojo/_base/array","dojo/number","dijit/registry", | ||
"esri/config","esri/SnappingManager","esri/dijit/Measurement","esri/tasks/locator","esri/graphic","esri/layers/GraphicsLayer","esri/dijit/Popup", | ||
"esri/dijit/PopupTemplate","esri/layers/WMSLayer","esri/layers/WMSLayerInfo","esri/urlUtils","esri/arcgis/utils","esri/geometry/Extent", | ||
"esri/layers/FeatureLayer","esri/layers/ImageParameters","esri/layers/CSVLayer","esri/layers/ArcGISTiledMapServiceLayer","esri/layers/ArcGISDynamicMapServiceLayer", | ||
"esri/symbols/SimpleLineSymbol","esri/symbols/SimpleFillSymbol","esri/symbols/TextSymbol","esri/symbols/Font","esri/tasks/GeometryService", | ||
"esri/tasks/query","dojo/dom-construct","dojo/dom-style","esri/renderers/SimpleRenderer","esri/layers/LabelLayer","esri/renderers/ClassBreaksRenderer", | ||
"esri/InfoTemplate","esri/symbols/SimpleMarkerSymbol","esri/symbols/PictureMarkerSymbol","agsjs/dijit/TOC","dijit/layout/BorderContainer","dijit/layout/ContentPane", | ||
"dijit/TitlePane","esri/dijit/Scalebar","esri/TimeExtent","esri/dijit/TimeSlider","esri/layers/TimeInfo","esri/request","dojo/_base/lang", | ||
"dojo/date/locale","dojo/request/xhr","dojo/fx","dojo/_base/array","dijit/TooltipDialog","dijit/popup","dojo/domReady!"], function(Map, webMercatorUtils, BasemapToggle, connect, Button, dom, parser, ready, on, Color, keys, arrayUtils, number, registry, esriConfig, SnappingManager, Measurement, | ||
Locator, Graphic, GraphicsLayer, Popup, PopupTemplate, WMSLayer, WMSLayerInfo, urlUtils, arcgisUtils, Extent, FeatureLayer, ImageParameters, CSVLayer, ArcGISTiledMapServiceLayer, ArcGISDynamicMapServiceLayer, | ||
SimpleLineSymbol, SimpleFillSymbol, TextSymbol, Font, GeometryService, Query, domConstruct, domStyle, SimpleRenderer, LabelLayer, ClassBreaksRenderer, InfoTemplate, | ||
SimpleMarkerSymbol, PictureMarkerSymbol, TOC, BorderContainer, ContentPane, TitlePane, Scalebar, TimeExtent, TimeSlider, TimeInfo, esriRequest, lang, locale, xhr, array, TooltipDialog, dijitPopup) |
Could not post complete page code as it is 1500 lines.
I'm not sure this is the issue, but you've added "dojo/_base/array" twice, once after Keys and once before TooltipDialog.
When I add many modules, I find it more helpful to organize them logically
require(["dojo/_base/array",
"dojo/_base/declare",
"dojo/_base/lang",
"dojo/Deferred",
"dojo/json",
"dojo/ready",
"dojox/gfx/fx",
"dgrid/OnDemandGrid",
"dgrid/Selection",
"dgrid/selector",
"dgrid/extensions/ColumnResizer",
"dgrid/extensions/ColumnHider",
"dgrid/util/mouse",
"dgrid/extensions/DijitRegistry",
"dijit/MenuItem",
"dijit/layout/TabContainer",
"dijit/registry",
"esri/map",
"esri/InfoTemplate",
"esri/dijit/Basemap",
"esri/dijit/BasemapGallery",
"esri/dijit/BasemapLayer",
"esri/dijit/Scalebar",
"modules/DVParameters",
"agsjs/dijit/TOC",
"dojo/fx",
"dojo/domReady!"
], function (array, declare, lang, Deferred, JSON, ready,
fx,
Grid, Selection, selector, ColumnResizer, ColumnHider, mouseUtil, DijitRegistry,
MenuItem, TabContainer, registry,
Map, InfoTemplate,
Basemap, BasemapGallery, BasemapLayer, Scalebar,
DVParameters
) {
Really appreciate the reply, I removed the extra "dojo/_base/array" and still getting the error printed in console. Also removed the corresponding "array" function call.
Can you show the portion of your code where you use TooltipDialog?
All I have added in is below. Fairly simple addition at this point. I stopped incorporating the example after it failed here.
dialog = new TooltipDialog({
id: "tooltipDialog",
style: "position: absolute; width: 250px; font: normal normal normal 10pt Helvetica;z-index:100"
});
dialog.startup();