POST
|
You have to add a dojo.require to your application to include the geometry service: dojo.require("esri.tasks.geometry"); More details on the compact build can be found here: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_compactbuild.htm
... View more
12-11-2010
08:14 AM
|
0
|
0
|
392
|
POST
|
On a related note its not necessary to specify all the values for the layer definition. Here's a simple layer definition that worked for me in your test application.
var mylayerDefinition = {
"geometryType": "esriGeometryPoint",
"drawingInfo": {
"renderer": {
"type": "simple",
"symbol": {
"type": "esriPMS",
"url": "reddot.png",
"imageData": "iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oGGBcGLvZ5AIUAAATDSURBVFjD3Zg/aBt3FMe/v9+d7iSfUnNClAolFWnsRaF4LKU2HrK4hJYMKUQiJRRClnbKEE8Z2s1Dh9Bkryk+OoQshZAlhGIPaUpxlIDbRgqOIlSZoNxhx2fpTr8/HXynKLXTnGQr/fPgkE7ip/vovff7vvd7REqJfswpFpMAJgFMABgLrt2sElwlAEuXT1mb4RcXP371c0hUMKdYfAvAGQAzGMxuAJi/fMpa2xewHUCaBppKQclmQVMpkNHRXdfJ9XUI2wav1yFsG/D9FwBNy1obGMwpFicBzAJIQtOgZDJQ83kQw+jLVdJ1wVZWwBuNEHATwJxpWUt9gznF4ucATgKAkssNBPRSwGo1/OiqaVlXIoM5xeJsGLrYxASU8XHsp/FyGZ1SqRta07LmXgnW9ZSmQZ+aAjFNDMOk48BbXAxDu8NzdJecOglgqFAAQEwT+tRUeHsyePZOsGD3zYbhGyZUL1xsYiK8nQ0YdnjsDICkksvte079nSnj41ByOQBIBgzPwQLSGWga1Hwer9vUfB7QNACYCb1Ge7wFJZPZsyQMFFLDgJLJ9EYOxC4UkgB+gKZBP3asfzAhCACAse1XVd3e5pTKfjXOu3kz3KUfqUFB3i4v/UAJQcAYla2WIl1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": "esriFieldTypeString",
"alias": "Name",
"length": 50
}]
};
... View more
12-08-2010
11:37 AM
|
0
|
0
|
685
|
POST
|
It looks like you'll need to specify the url to the symbol for this to work in IE 8. If the url property doesn't contain http:// it assumes that the location is relative.
"symbol": {
"type": "esriPMS",
"url": "http://somename/somelocation/reddot.png",
"imageData": "iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oGGBcGLvZ5AIUAAATDSURBVFjD3Zg/aBt3FMe/v9+d7iSfUnNClAolFWnsRaF4LKU2HrK4hJYMKUQiJRRClnbKEE8Z2s1Dh9Bkryk+OoQshZAlhGIPaUpxlIDbRgqOIlSZoNxhx2fpTr8/HXynKL.........
... View more
12-08-2010
11:36 AM
|
0
|
0
|
685
|
POST
|
You can increase the size of the symbol swatches using something like this: .esriLegendService img{
width:55px;
}
... View more
12-06-2010
09:50 AM
|
0
|
0
|
1424
|
POST
|
The Map.graphics object is only available after the map's onLoad event has fired. For example:
dojo.connect(map, "onLoad", function() { ShowLocation(-81.3765, 28.54175); });
function ShowLocation(x, y)
{
var point = new esri.geometry.Point(x, y, new esri.SpatialReference({wkid:4326}));
var simpleMarkerSymbol = new esri.symbol.SimpleMarkerSymbol();
var graphic = new esri.Graphic(point, simpleMarkerSymbol);
map.graphics.add(graphic);
}
... View more
12-06-2010
07:55 AM
|
0
|
0
|
875
|
POST
|
There are several css classes for the legend dijit that allow you to alter the default appearance, here's an example where the font color and family are modified for the text in the legend: .esriLegendLayerLabel{
font-family:'Monotype Corsiva';
color:red;
}
.esriLegendServiceLabel{
font-family: 'Times New Roman';
color:green;
}
.esriLegendService{
color:orange;
font-weight:bold;
} The API Reference for the JavaScript API has a listing of the CSS classes.
... View more
12-06-2010
07:44 AM
|
0
|
1
|
1424
|
POST
|
You can check to see if the map's info window is displayed using the InfoWindow's isShowing property. If the InfoWindow is visible you can then call the hide method.
... View more
12-01-2010
06:26 AM
|
0
|
0
|
279
|
POST
|
Mark, Here's a code snippet that worked for me:
dojo.connect(layer,"onBeforeApplyEdits",function(adds,updates,deletes){
dojo.forEach(adds,function(add){
add.attributes.symbolid = new Date().getTime().toString();
});
});
... View more
12-01-2010
06:23 AM
|
0
|
0
|
738
|
POST
|
esri.bundle contains various tooltip and other informative messages. Do you have code that reproduces the problem? If so I'd be happy to take a look.
... View more
11-16-2010
09:27 AM
|
0
|
0
|
343
|
POST
|
I haven't seen this behavior, can you reproduce the problem with one of the sample? If so which one?
... View more
11-15-2010
08:32 AM
|
0
|
0
|
343
|
POST
|
You are correct, in the sample you like the southerly postion is used. The Scalebar widget help topic provides a few details about the location used to calculate the scale when placed externally. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/scalebar.htm Presumably the most southerly latitude is still used when using the scalebar in an external container, like in this sample.
... View more
11-12-2010
10:19 AM
|
0
|
0
|
526
|
POST
|
This question comes up frequently so I added a new sample to the ArcGIS Resource Center this morning showing how to format the contents of an info window. The sample formats string values but could easily be modified to apply numeric or date formatting. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples/fl_infowindow.html FYI: We are making some changes at 2.2 that will simplify this process.
... View more
11-11-2010
07:57 AM
|
0
|
0
|
387
|
POST
|
One approach would be to use esri.request then add each layer to the map: dojo.require('esri.layers.FeatureLayer');
var baseURL;
var map;
function init() {
var initExtent = new esri.geometry.Extent({"xmin":-8590965.388453046,"ymin":4695877.530747742,"xmax":-8553434.807565076,"ymax":4711164.936404756,"spatialReference":{"wkid":102100}});
map = new esri.Map("map",{extent:initExtent});
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
map.addLayer(basemap);
baseURL = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/MapServer";
esri.request({
url:baseURL,
content:{f:"json"},
callbackParamName:"callback",
load:addLayers,
error:esriConfig.defaults.io.errorHandler
});
}
function addLayers(response,args){
dojo.forEach(response.layers,function(layer){
var featureLayer = new esri.layers.FeatureLayer(baseURL + "/" + layer.id,{
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
map.addLayer(featureLayer);
});
}
dojo.addOnLoad(init);
... View more
11-09-2010
08:36 AM
|
0
|
0
|
300
|
POST
|
It looks like the map's onLoad event wasn't firing. I moved the code that hooks up the onload event above the lines that add the openstreetmap layer and the polygon displays (see attached).
... View more
11-09-2010
08:03 AM
|
0
|
0
|
266
|
POST
|
The feature layer has an applyedits method that you can use to add new features to a feature layer. The following samples show how to use this method. http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/ed_feature_creation.html http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/mobile_geolocaterenderer.html
... View more
11-02-2010
07:48 AM
|
0
|
0
|
790
|
Title | Kudos | Posted |
---|---|---|
2 | Friday | |
1 | a week ago | |
1 | a week ago | |
1 | 09-24-2024 02:37 PM | |
2 | 09-24-2024 09:12 AM |
Online Status |
Offline
|
Date Last Visited |
Friday
|