|
POST
|
Try downloading the zipped source from the resource center. Unzip it and load the page in the "examples" directory. Does that work?
... View more
02-17-2011
10:27 AM
|
0
|
0
|
2925
|
|
POST
|
This is not likely to happen anytime soon. Your best bet is to post specific, targeted questions here (or better yet, gis.se) and work with other users to address the problems you're having (I'm happy to help however I can). There's also Esri support if you're an AGS customer. That being said, if you've been hung up for six months I would say it's time for you to re-define "trivial" or come to terms with the fact that maybe the JavaScript API isn't for you...
... View more
02-15-2011
07:15 AM
|
0
|
0
|
593
|
|
POST
|
What browser are you using? Chrome with the JS console open or Firefox with Firebug on are the only two viable options for debugging, IMO.
... View more
02-11-2011
09:31 AM
|
0
|
0
|
3048
|
|
POST
|
When I run your code in chrome I get this error: Uncaught TypeError: Cannot call method 'add' of null What does that tell you? Since the only add method you're calling is map.graphics.add(), it's clear that function call is failing. You need to wait for the map to load before you can add graphics. Did you notice that the link I posted previously puts the code that actually adds graphics inside a function that runs after the map loads? Anyway, here's a working version of your code, which uses esri.geometry.geographicToWebMercator() to get a geometry that is suitable to add to the map: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Create a Map</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.1/js/dojo/dijit/themes/claro/claro.css">
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1"></script>
<script type="text/javascript">
dojo.require("esri.map");
dojo.require("esri.graphic");
dojo.require("esri.geometry");
dojo.require("esri.arcgis.utils");
var map;
function init() {
var myExtent = new esri.geometry.Extent(-107,25,-92,36, new esri.SpatialReference({wkid:4326}));
map = new esri.Map("mapDiv", {extent:esri.geometry.geographicToWebMercator(myExtent) });
var basemapURL= "http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer";
var basemap = new esri.layers.ArcGISTiledMapServiceLayer(basemapURL);
map.addLayer(basemap);
dojo.connect(map, 'onLoad', function() {
var myPolygon = new esri.geometry.Polygon(new esri.SpatialReference({wkid:4326}));
myPolygon.addRing([[-99.24,28.39],[-99.24,29.37],[-99.482,29.37],[-99.24,28.39]]);
// map is in web mercator so transform the geometry
var poly_wm = esri.geometry.geographicToWebMercator(myPolygon);
var symbol = new esri.symbol.SimpleFillSymbol().setStyle(esri.symbol.SimpleFillSymbol.STYLE_SOLID);
polygonGraphic = new esri.Graphic(poly_wm, symbol); ///*** how to convert the polygon geometry????? *******////
map.graphics.add(polygonGraphic);
});
}
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
<div id="mapDiv" style="width:900px; height:600px; border:1px solid #000;"></div>
</body>
</html>
... View more
02-11-2011
09:19 AM
|
0
|
0
|
3048
|
|
POST
|
http://www.esri.com/software/arcgis/arcgisserver/index.html
... View more
02-11-2011
09:10 AM
|
0
|
0
|
602
|
|
POST
|
Check out what I posted a couple of months ago over on gis.se: http://gis.stackexchange.com/questions/2749/esri-json-polygon-ring-orientation/2750#2750 Also, esri.geometry.geographicToWebMercator() works for polygons so do something like this: var poly_wm = esri.geometry.geographicToWebMercator(myPolygon);
map.graphics.add(new esri.Graphic(poly_wm, sfs));
... View more
02-11-2011
08:57 AM
|
0
|
0
|
3048
|
|
POST
|
It's a pretty simple task to take the Toggle multiple ArcGIS Online services sample and convert it to use a radio buttons instead of normal buttons.
... View more
02-08-2011
06:56 AM
|
0
|
0
|
1466
|
|
POST
|
Can't be done...you'll need to publish your .shp file as a map service. The other possibility, if you're not dealing with a large number of features (let's say <1000), is to convert your features to .json, grab them and then display them as graphics on top of a basemap.
... View more
02-08-2011
06:52 AM
|
0
|
0
|
558
|
|
POST
|
Your code is running before the esri API is loaded. Do something like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">var djConfig = {parseOnLoad: true};</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1"></script>
<script type="text/javascript">
function init() {
var imageParametersPng32 = new esri.layers.ImageParameters();
imageParametersPng32.format = "png32";
}
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
</body>
</html>
... View more
02-07-2011
07:11 AM
|
0
|
0
|
613
|
|
POST
|
Use a geometry service: measure polygon area and perimeter sample.
... View more
02-07-2011
07:03 AM
|
0
|
0
|
530
|
|
POST
|
That code looks familiar ... I'm sure I've seen it somewhere before :).
... View more
02-07-2011
07:00 AM
|
0
|
0
|
1180
|
|
POST
|
Use: console.log("name: " + attr[displayName]); Your example code that fails is looking for a property named "displayName" on the attr object. The syntax I used lets you specify a property name as a string.
... View more
02-06-2011
04:09 PM
|
0
|
0
|
516
|
|
POST
|
Check out this sample: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/map_dialog.html
... View more
02-04-2011
09:19 AM
|
0
|
0
|
1437
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-23-2012 07:54 AM | |
| 1 | 05-28-2010 08:31 AM | |
| 1 | 11-12-2012 08:12 AM | |
| 3 | 02-23-2012 10:57 AM | |
| 1 | 06-27-2011 08:51 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|