POST
|
Basically, the usual workflow is to add a basemap which is a tiledmapservice layer. Then we add either ArcGISDynamicMapService layer and/or Feature layer. Using feature layer you get access to your data, feature layer gets the data back to the client while a DynamicMapService layer gets snapshot of your data in the form of a image to the client and not the actual data. Query Task is independent on the service you are using. QueryTask is performed on a specific layer to query/filter data and get it back to client. Please go through the documentation here for QueryTask. Feature Layera are also explained nicely here.
... View more
08-23-2013
08:19 AM
|
0
|
0
|
254
|
POST
|
applying onclcik function to map object This will apply onClick to the map, in simple words, if you click anywhere on the map the on click event will fire. applying onclick to featurelayer service When you apply on click to a feature layer, it'll only fire when you click on any feature on the map.
... View more
08-23-2013
08:09 AM
|
0
|
0
|
308
|
POST
|
Follow the code and see if this what you were looking for. <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Feature Layer - display results as an InfoWindow onHover</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.6/js/dojo/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.6/js/esri/css/esri.css">
<style>
html, body, #mapDiv {
padding:0;
margin:0;
height:100%;
}
#mapDiv {
position: relative;
}
#info {
background: #fff;
box-shadow: 0 0 5px #888;
left: 1em;
padding: 0.5em;
position: absolute;
top: 1em;
z-index: 40;
}
</style>
<script src="http://js.arcgis.com/3.6/"></script>
<script>
var map, dialog;
require([
"esri/map", "esri/layers/FeatureLayer",
"esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol",
"esri/renderers/SimpleRenderer", "esri/graphic", "esri/lang",
"dojo/_base/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
) {
map = new Map("mapDiv", {
basemap: "streets",
center: [-80.94, 33.646],
zoom: 8,
slider: false
});
var southCarolinaCounties = new FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3", {
mode: FeatureLayer.MODE_SNAPSHOT,
outFields: ["NAME", "POP2000", "POP2007", "POP00_SQMI", "POP07_SQMI"]
});
southCarolinaCounties.setDefinitionExpression("STATE_NAME = 'South Carolina'");
var symbol = new SimpleFillSymbol(
SimpleFillSymbol.STYLE_SOLID,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([255,255,255,0.35]),
1
),
new Color([125,125,125,0.35])
);
southCarolinaCounties.setRenderer(new SimpleRenderer(symbol));
map.addLayer(southCarolinaCounties);
map.infoWindow.resize(245,125);
dialog = new TooltipDialog({
id: "tooltipDialog",
style: "position: absolute; width: 250px; font: normal normal normal 10pt Helvetica;z-index:100"
});
dialog.startup();
var highlightSymbol = new SimpleFillSymbol(
SimpleFillSymbol.STYLE_SOLID,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([255,0,0]), 3
),
new Color([125,125,125,0.35])
);
//close the dialog when the mouse leaves the highlight graphic
map.on("load", function(){
map.graphics.enableMouseEvents();
map.graphics.on("mouse-out", closeDialog);
});
//listen for when the onMouseOver event fires on the countiesGraphicsLayer
//when fired, create a new graphic with the geometry from the event.graphic and add it to the maps graphics layer
southCarolinaCounties.on("click", function(evt){
var t = "<b>${NAME}</b><hr><b>2000 Population: </b>${POP2000:NumberFormat}<br>"
+ "<b>2000 Population per Sq. Mi.: </b>${POP00_SQMI:NumberFormat}<br>"
+ "<b>2007 Population: </b>${POP2007:NumberFormat}<br>"
+ "<b>2007 Population per Sq. Mi.: </b>${POP07_SQMI:NumberFormat}";
var content = esriLang.substitute(evt.graphic.attributes,t);
var highlightGraphic = new Graphic(evt.graphic.geometry,highlightSymbol);
map.graphics.add(highlightGraphic);
dialog.setContent(content);
domStyle.set(dialog.domNode, "opacity", 0.85);
dijitPopup.open({
popup: dialog,
x: evt.pageX,
y: evt.pageY
});
});
function closeDialog() {
map.graphics.clear();
dijitPopup.close(dialog);
}
});
</script>
</head>
<body class="tundra">
<div id="mapDiv">
<div id="info">
Hover over a county in South Carolina to get more information.
</div>
</div>
</body>
</html> Do it depend on rest service that we are using whether we can add onclick funtionality or how does mous event work No it does not depend on the REST service. These are all client side events and does not rely on the service. Service is only responsible to supply us the data when requested.
... View more
08-22-2013
08:04 AM
|
0
|
0
|
308
|
POST
|
HI All, I am starting with ArcGis for our application.I am not sure when and how do these matter.When i look at api reference there are so may api .Layer,dijit ,geometry , geocoder .If i want to display map and have interactive feature on this which service should i use. Follow this sample to display a map. If you want to just show your data on map, you can use ArcGISDynamicMapServiceLayer. Sample which shows how to add a DynamicMapServiceLayer. There are different classes for different functionality, if you wish to add Geocoding to your applicaiton, then you can use the Geocoder widget. If you want to perform some analysis/operation like buffer, project, distance etc. , you'll have to use the GeometryService. If you want to query your data and show it in a popup window, you'll have to use a QueryTask. It you want to add editing capability, you'll have to use Editor Widget.
... View more
08-22-2013
07:55 AM
|
0
|
0
|
254
|
POST
|
local copy to download Javascript API 3.6 should be available on Esri website within a week.
... View more
08-15-2013
03:01 PM
|
0
|
0
|
192
|
POST
|
The gray basemap is a web map that uses the light gray base as the basemap and also includes the reference map service. The reference map service is used to display place labels. See more about the map here: http://www.arcgis.com/home/item.html?id=8b3d38c0819547faa83f7b7aca80bd76 If you want the light gray basemap without the reference labels they can add it directly as a tiled map service layer instead of using the map's basemap constructor option. http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer You can see the 404's because there is no labels at those scales, as you go deeper you will not notice these errors.
... View more
08-15-2013
12:48 PM
|
0
|
0
|
247
|
POST
|
Savkil, After changing the url, I am getting "Client id cannot be determined" What does your URL look like? Did you use web adaptor name as 'ArcGIS'?
... View more
08-13-2013
10:52 AM
|
0
|
0
|
1558
|
POST
|
svakil, I am using the same web reference(http://servername/arlgis/tokens/) that you have mentioned to generate token (please see attachment in my original post). Can you send me url again, the one you have mentioned is not coming up (please copy/paste full url here). Thanks for your help. Here is the explanation of the issue: 1. NIM084195 is a bug that has been logged regarding an issue creating tokens and using a web adaptor named anything other than 'ArcGIS'. In your case it is "arlgis". 2. The workaround for NIM084195 is to use a web adaptor named 'ArcGIS'. This has been fixed in version 10.2 of ArcGIS Server. You can also try creating token bypassing the web adapter directly from the port 6080 where ArcGIS Server is installed. I am assuming you have ArcGIS Server 10.1 or 10.1 SP1 .
... View more
08-13-2013
07:40 AM
|
0
|
0
|
1558
|
POST
|
Hi kshahzad, I saw a bug submitted for the same. Here is the bug details. It has been fixed in ArcGIS Server 10.2 . As a workaround try generating token from http://<servername>:6080/arlgis/tokens/ instead of using web adapter.
... View more
08-12-2013
01:46 PM
|
0
|
0
|
1558
|
POST
|
You can take a look into this export item operation from REST API which can output csv and shapefile. Update: it'll only work for hosted feature service.
... View more
07-26-2013
12:52 PM
|
0
|
0
|
167
|
POST
|
There is a similar thread which talks about this issue.
... View more
07-12-2013
01:13 PM
|
0
|
0
|
258
|
POST
|
Hi, You can use esri.show() and esri.hide() to add a splash screen. Here is a simple code sample which demonstrates the same: <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>Splash Screen</title>
<link rel="stylesheet" href="https://community.esri.com//serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="https://community.esri.com//serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/esri/css/esri.css">
<style type="text/css">
html, body
{
height: 100%;
width: 100%;
margin: 0;
padding: 0px;
font-family: helvetica, arial, sans-serif;
font-size: 90%;
}
#mapDiv
{
margin: 0px;
border: solid 1px #B5BCC7;
height: 100%;
width: 100%;
}
</style>
<script>var dojoConfig = { parseOnLoad: true };</script>
<script src="//serverapi.arcgisonline.com/jsapi/arcgis/3.5/"></script>
<script>
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("esri.map");
dojo.require("esri.layers.FeatureLayer");
dojo.require("esri.IdentityManager");
dojo.require("esri.IdentityManagerBase");
var map;
function init() {
map = new esri.Map("mapCanvas",{
center: [-107.394, 37.563],
zoom: 9
});
esri.show(splashScreen);
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer");
map.addLayer(basemap);
dojo.connect(map, "onLoad", function() {
//esri.hide(splashScreen);
});
}
function hideSplash(){
esri.hide(splashScreen);
map.resize();
map.reposition();
}
dojo.ready(init);
</script>
</head>
<body class="tundra">
<div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline',gutters:false" style="position:relative;width:100%;height:100%;">
<div id="mapCanvas" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'" style="height:900px;">
<div data-dojo-type="dijit/Dialog" id="splashScreen" title="Welcome" style="position: absolute; top: 300px; left: 400px; z-index: 100;width:600px">
<table class="dijitDialogPaneContentArea">
<tr>
<td>
<div id="divDialogMessage">This is the splash text</div>
</td>
</tr>
</table>
<div class="dijitDialogPaneActionBar">
<button id="buttonClose" data-dojo-type="dijit/form/Button" type="button" style="align-content: center" onclick="hideSplash();">Close</button>
</div>
</div>
</div>
</div>
</body>
</html> Please let me know if it helps! Thanks, Shreyas
... View more
07-01-2013
01:11 PM
|
1
|
0
|
751
|
POST
|
here is another sample on our help page for identify task.
... View more
06-26-2013
07:30 AM
|
0
|
0
|
194
|
POST
|
I would love to -- but how do I do that? Sorry, the obvious things evade me sometimes... Please see the attached image. [ATTACH=CONFIG]25376[/ATTACH]
... View more
06-19-2013
12:22 PM
|
0
|
0
|
982
|
POST
|
Thanks for leading me in the right direction. The code I posted was just a proof of concept, just to demonstrate how to add the legends. I am glad you found a good solution to dynamically create a list of layer ids!!! It would be great if you could mark this as answer, might help other. Thanks, Shreyas
... View more
06-19-2013
12:08 PM
|
0
|
0
|
982
|
Title | Kudos | Posted |
---|---|---|
1 | 07-01-2013 01:11 PM | |
1 | 11-14-2012 11:36 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|