|
POST
|
Hi Ashley, What is the error you are receiving when you attempt to run your code?
... View more
04-29-2014
02:57 AM
|
0
|
0
|
3459
|
|
POST
|
Here is an example: VDate = "time.strftime('05/02/2014')"
... View more
04-28-2014
04:30 AM
|
0
|
0
|
2022
|
|
POST
|
Hi Padmisiri, You will want to format the date like the following: time.strftime('05/02/2014') Ex: arcpy.CalculateField_management("BLD_PG", "BLD_PG_DT", "time.strftime('05/02/2014')", "PYTHON")
... View more
04-25-2014
04:15 AM
|
0
|
0
|
2022
|
|
POST
|
Hi Andrew, Try the following: var pastDate = new Date(); pastDate.setDate(pastDate.getDate()-90); pastDate = pastDate.getMonth()+1 + "/" + pastDate.getDate() + "/" + pastDate.getYear(); featureLayer.setDefinitionExpression("stormdate > date '" + pastDate + "'");
... View more
04-24-2014
11:27 AM
|
0
|
0
|
898
|
|
POST
|
If you'd like, post your code as you have it in your project. Be sure to wrap it in CODE tags.
... View more
04-24-2014
05:16 AM
|
0
|
0
|
1770
|
|
POST
|
Looks like you forgot to call the "dojo/parser" module. http://jsfiddle.net/WyMzY/12/
... View more
04-23-2014
11:30 AM
|
0
|
0
|
1770
|
|
POST
|
Can you post your JavaScript code, or create a jfsiddle?
... View more
04-23-2014
08:43 AM
|
0
|
0
|
2472
|
|
POST
|
The navigation zoom in/out will always be created when using the Map class. For the Overview window, you can control this by specifying the 'attachTo' parameter: require([ "esri/map", "esri/dijit/OverviewMap", ... ], function(Map, OverviewMap, ... ) { var map = new Map( ... ); var overviewMapDijit = new OverviewMap({ map: map, attachTo: "bottom-right", color:" #D84E13", opacity: .40 }); ... }); or by specifying an HTML element: require([ "esri/map", "esri/dijit/OverviewMap", "dojo/dom", ... ], function(Map, OverviewMap, dom, ... ) { var map = new Map( ... ); var globals; globals.overviewMapDijit = new OverviewMap({ map: map }, dom.byId('overviewMapDiv')); ... }); See the following link for more info: https://developers.arcgis.com/javascript/jsapi/overviewmap-amd.html
... View more
04-23-2014
07:45 AM
|
0
|
0
|
2472
|
|
POST
|
You will need to pass the coordinates as an array. See the following link. Create a new polygon by providing an array of geographic coordinate pairs. For a single ring polygon specify an array of coordinate pairs. For a multi-ring polygon specify an array of array coordinate pairs.
... View more
04-23-2014
04:49 AM
|
0
|
0
|
1631
|
|
POST
|
Hi Michael, You will need to change the grid.on("rowclick", onRowClickHandler) to grid.on("rowclick", zoomRow). Also, for the zoomRow function variable, set this to 'evt'. I couldn't figure out how to show the zoom-in icon, but here is an example that works with a sample service. It will zoom to the point feature when a row is clicked. <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--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>Display Find Task results in Dojo DataGrid</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dojox/grid/resources/Grid.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dojox/grid/resources/claroGrid.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
</style>
<script src="http://js.arcgis.com/3.8/"></script>
<style type="text/css">
.dojoxGrid table {
margin: 0;
}
.dojoxGrid th, tr {
font-size: 8pt;
}
</style>
<script>
require([
"esri/map",
"esri/tasks/FindTask",
"esri/tasks/FindParameters",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleFillSymbol",
"esri/layers/FeatureLayer",
"dojo/_base/Color",
"dojo/on",
"dojo/dom",
"dijit/registry",
"dojo/_base/array",
"dojo/_base/connect",
"dojox/grid/DataGrid",
"dojo/data/ItemFileReadStore",
"dijit/form/Button",
"dojo/parser",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojo/domReady!"
], function(
Map, FindTask, FindParameters, SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol, FeatureLayer,
Color, on, dom, registry, arrayUtils, connect, DataGrid, ItemFileReadStore, Button, parser
) {
var findTask, findParams;
var map, center, zoom;
var grid, store;
parser.parse();
registry.byId("search").on("click", doFind);
center = [-98.258, 38.236];
zoom = 4;
map = new esri.Map("map", {
basemap: "streets",
center: center,
zoom: zoom
});
var flMCY_Stores = new FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0", {
outFields: ["*"]
});
map.addLayer(flMCY_Stores);
findTask = new FindTask("http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer");
map.on("load", function () {
findParams = new FindParameters();
findParams.returnGeometry = true;
findParams.layerIds = [0];
findParams.searchFields = ["AREANAME"];
findParams.outSpatialReference = map.spatialReference;
});
function doFind() {
findParams.searchText = dom.byId("txtStoreName").value;
findTask.execute(findParams, showResults);
}
function showResults(results) {
map.graphics.clear();
var symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 12,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_NULL, new Color([0, 0, 0, 0.9]), 1), new Color([0, 0, 0, 0.5])
);
var items = arrayUtils.map(results, function (result) {
var graphic = result.feature;
graphic.setSymbol(symbol);
map.graphics.add(graphic);
return result.feature.attributes;
});
var data = {
identifier : "OBJECTID",
label : "OBJECTID",
items : items
};
store = new ItemFileReadStore({
data : data
});
var grid = registry.byId("grid");
grid.setStore(store);
grid.setSortIndex(3,"true");
grid.on("rowclick", zoomRow);
map.centerAndZoom(center, zoom);
}
function makeZoomButton(id){
var zBtn = "<div data-dojo-type='dijit.form.Button'><img src='images/zoom.png'";
zBtn = zBtn + " width='18' height='18'";
zBtn = zBtn + " onClick=\"zoomRow('"+id+"')\"></div>";
return zBtn;
}
function zoomRow(evt){
var clickedTaxLotId = evt.grid.getItem(evt.rowIndex).OBJECTID;
var selectedTaxLot = arrayUtils.filter(map.graphics.graphics, function (graphic) {
return ((graphic.attributes) && graphic.attributes.OBJECTID === clickedTaxLotId);
});
var center2 = [selectedTaxLot[0].geometry.getLongitude(), selectedTaxLot[0].geometry.getLatitude()];
var zoom2 = 15;
map.centerAndZoom(center2, zoom2);
}
});
</script>
</head>
<body class="claro">
<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline'" style="width:100%;height:100%;margin:0;">
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'left'" style="height:40px;">
<p>Store name:
<input type="text" id="txtStoreName" size="100px" value="Dothan" />
</p>
<p> </p>
<button id="search" data-dojo-type="dijit.form.Button" type="button" data-dojo-attach-point="button" >Search
</button>
</div>
<div id="map" data-dojo-props="region:'center'" data-dojo-type="dijit/layout/ContentPane" style="border:1px solid #000;"></div>
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'bottom'" style="height:150px;">
<table data-dojo-type="dojox/grid/DataGrid" data-dojo-id="grid" id="grid" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'">
<thead>
<tr>
<th field="OBJECTID" formatter='makeZoomButton' width="40px">
<img alt="+" src="images/zoom.png" width="18" height="18"/>
</th>
<th field="OBJECTID" width="50px">ID</th>
<th field="CLASS" width="70px">Store No</th>
<th field="AREANAME" width="150px">Store Name</th>
<th field="CAPITAL" width="250px">Address</th>
<th field="POP2000" width="50px">Sales</th>
<th field="ST" width="50">GSF</th>
</tr>
</thead>
</table>
</div>
</div>
</body>
</html>
... View more
04-23-2014
03:53 AM
|
0
|
0
|
840
|
|
POST
|
Hi Alan, You can place the code within a function and execute it using the field calculator (right-click on 'Shape' field). Ex: def update():
fc = r"C:\temp\python\test.gdb\Vehicle"
pnt = arcpy.Point()
rows = arcpy.UpdateCursor(fc)
for row in rows:
pnt.X = row.GPS_X
pnt.Y = row.GPS_Y
row.shape = pnt
rows.updateRow(row)
del row, rows Be sure that you have 'Python' checked at the top of the field calculator, and you will want to specify 'update()' under the Pre-logic script code dialog. Ex: [ATTACH=CONFIG]33269[/ATTACH]
... View more
04-23-2014
02:41 AM
|
1
|
0
|
6998
|
|
POST
|
Hi Dipti, Take a look at this example. This should get you going in the right direction. <!DOCTYPE html>
<html>
<head>
<title>Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">
<style>
html, body, #mapDiv{
padding: 0;
margin: 0;
height: 100%;
}
</style>
<script src="http://js.arcgis.com/3.8/"></script>
<script>
var map;
require([
"esri/map",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleLineSymbol",
"dojo/_base/Color",
"esri/graphic",
"esri/geometry/Polygon",
"dojo/on",
"dojo/dom",
"dojo/domReady!"
],
function(
Map, SimpleFillSymbol, SimpleLineSymbol, Color,
Graphic, Polygon,
on, dom
) {
map = new Map("mapDiv", {
center: [174.605369, -37.120276],
zoom: 15,
basemap: "streets"
});
on(map, "load", addGraphic);
var sfs = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color([255,0,0]), 2),new Color([255,255,0,0.25])
)
function addGraphic(){
var singleRingPolygon = new Polygon([[174.605111568859, -37.119413675388707], [174.6051123299834, -37.119449718193458], [174.60515905129122, -37.119530204987136], [174.60540067619004, -37.119779304335452], [174.60554255499551, -37.120101860545844], [174.60568043759687, -37.120235191897571], [174.60572696965184, -37.1203066677341], [174.60572849253467, -37.120378753310746], [174.60570674933629, -37.120415100973361], [174.60560757225889, -37.120515590528086], [174.60554177129595, -37.120597601350227], [174.60549026791193, -37.120823630882519], [174.6054873903158, -37.121220253972716], [174.6055119446122, -37.122382633739591], [174.60513274122792, -37.119350295725816], [174.605111568859, -37.119413675388707]]);
var gra = new Graphic(singleRingPolygon, sfs);
map.graphics.add(gra);
}
});
</script>
</head>
<body class="claro">
<div id="mapDiv"></div>
</body>
</html>
... View more
04-22-2014
04:21 AM
|
0
|
0
|
1631
|
|
POST
|
Hi Minxue, It looks like you are specifying 100% transparency for the Color in the selection symbol. Change: var selectionSymbol = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255,255,0,0]), 3); to: var selectionSymbol = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255,255,0]), 3);
... View more
04-22-2014
03:45 AM
|
0
|
0
|
2053
|
|
POST
|
Hi Tracy, This should work if your outSpatialReference is set to the same as the map. How did you define the 'spatialReference' variable? i.e. var spatialReference = new SpatialReference(102100);
... View more
04-14-2014
11:24 AM
|
0
|
0
|
1004
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-08-2026 12:27 PM | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Offline
|
| Date Last Visited |
Tuesday
|