|
POST
|
Hi Tony, Some suggestions: -you don't need to load dojo yourself, it's included in the JS API so you can remove your script tag referencing the AOL CDN -your query returns polygons so you need to use a SimpleFillSymbol, not a SimpleMarkerSymbol (the latter is for points) -typo when defining query.returnGeomety (your code uses "returnGeomertry") -use resultFeatures.features in your for loop to add graphics Here's a working example with these changes:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>CC test map</title>
<link href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/dojo/dijit/themes/claro/claro.css" rel="stylesheet" type="text/css" >
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5"></script>
<script type="text/javascript">
dojo.require("esri.tasks.query");
dojo.require("esri.map");
function init() {
map = new esri.Map("mapDiv");
var layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://lrs.co.columbia.wi.us/ArcGIS/rest/services/LRS/TaxParcels_Parcels/MapServer")
map.addLayer(layer);
dojo.connect(dojo.byId('queryButton'), 'onclick', runQuery);
}
function runQuery() {
queryTask = new esri.tasks.QueryTask("http://lrs.co.columbia.wi.us/ArcGIS/rest/services/LRS/TaxParcels_Parcels/MapServer/0");
query = new esri.tasks.Query();
query.returnGeometry = true;
query.text = "11177-153";
queryTask.execute(query, showResults);
}
function showResults(resultFeatures) {
console.log('result: ', resultFeatures);
map.graphics.clear();
var symbol = new esri.symbol.SimpleFillSymbol();
for (var i = 0, il = resultFeatures.features.length; i < il; i++) {
var graphic = resultFeatures.features;
graphic.setSymbol(symbol);
map.graphics.add(graphic);
}
// zoom to the feature
if ( resultFeatures.features.length > 0 ) {
map.setExtent(esri.graphicsExtent(resultFeatures.features));
}
}
dojo.ready(init);
</script>
</head>
<body class="claro">
<div id="mapDiv" style="width:600px; height:600px; border:1px solid #000;"></div>
<input type="button" value="Get Details" id="queryButton" />
</body>
</html>
... View more
10-17-2011
01:40 PM
|
0
|
0
|
645
|
|
POST
|
Is this still the link to see your issues: http://arcviewdev.uww.edu/javamap.html That page doesn't load a map for me and is using 2.3.
... View more
10-17-2011
12:11 PM
|
0
|
0
|
1481
|
|
POST
|
What specific statements are required so the compiler knows were the components are for an API? You get access to the API by including it in your page via a script tag:
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5"></script>
what is the benefits of using an Array? Depends what you need to do...can you be more specific?
... View more
10-16-2011
06:27 PM
|
0
|
0
|
364
|
|
POST
|
Looking into formatting an info window or popup: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp/intro_formatinfowindow.htm Also, is your service publicly accessible? I'm not able to see it...
... View more
10-14-2011
07:42 AM
|
0
|
0
|
805
|
|
POST
|
The "Compare Web Maps" template on arcgis.com does this, here's an example: http://apps.arcgis.com/hosted/Compare/Configure/index.html?webmap=ce4cbe1d06e2484284ffd692dfa62545 Make sure you check on "scale" and "location" under synchronize maps near the bottom of the page.
... View more
10-14-2011
07:34 AM
|
0
|
0
|
1241
|
|
POST
|
What's the spatial reference of your map? Is it geographic? Or are you using web mercator? If you're using web mercator, convert from lat, long to web merc using esri.geometry.geographicToWebMercator before creating your graphic. There's also a syntax issue with how you are defining your points. You should either pass your points to the MultipPoint constructor (as shown below) or use the addPoint() method to add points.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title></title>
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/dojo/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/esri/dijit/css/Popup.css">
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
#map{ margin: 0; padding: 0; }
</style>
<script>var dojoConfig = { parseOnLoad: true };</script>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5"></script>
<script>
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("esri.map");
var map;
function init() {
var initExtent = new esri.geometry.Extent({"xmin":-14052134,"ymin":5562249,"xmax":-13179529,"ymax":5897349,"spatialReference":{"wkid":102100}});
map = new esri.Map("map",{extent:initExtent});
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
map.addLayer(basemap);
dojo.connect(map, 'onLoad', function() {
dojo.connect(dijit.byId('map'), 'resize', map, map.resize);
var points = {
"points": [[-122.63,45.51],[-122.56,45.51],[-122.56,45.55],[-122.62,45.00],[-122.59,45.53]],
"spatialReference": ({ "wkid": 4326 })
};
var mp = new esri.geometry.Multipoint(points);
var wm_mp = esri.geometry.geographicToWebMercator(mp);
var sms = new esri.symbol.SimpleMarkerSymbol();
var infoTemplate = new esri.InfoTemplate("Vernal Pool Locations", "");
var graphic = new esri.Graphic(wm_mp, sms, '', infoTemplate);
map.graphics.add(graphic);
});
}
dojo.ready(init);
</script>
</head>
<body class="tundra">
<div data-dojo-type="dijit.layout.BorderContainer"
data-dojo-props="design:'headline',gutters:false"
style="width: 100%; height: 100%; margin: 0;">
<div id="map"
data-dojo-type="dijit.layout.ContentPane"
data-dojo-props="region:'center'">
</div>
</div>
</body>
</html>
... View more
10-14-2011
07:30 AM
|
0
|
1
|
1441
|
|
POST
|
Hi Brad, You can use https by adding the following code to your app (please use your own bing key):
esri.setRequestPreCallback(function(ioArgs) {
if(ioArgs.url.search("serverapi.arcgisonline.com/veadaptor/") > 0) {
ioArgs.url = ioArgs.url.replace("http:", "https:");
}
return ioArgs;
});
//Creates the Virtual Earth layer to add to the map
veTileLayer = new esri.virtualearth.VETiledLayer({
bingMapsKey: 'Ah29HpXlpKwqVbjHzm6mlwMwgw69CYjaMIiW_YOdfTEMFvMr5SNiltLpYAcIocsi',
mapStyle: esri.virtualearth.VETiledLayer.MAP_STYLE_AERIAL
});
dojo.connect(veTileLayer, "onLoad", function(veTileLayer) {
veTileLayer.tileServers = dojo.map(veTileLayer.tileServers, function(tileServer) {
return tileServer.replace("http:", "https:");
});
});
We'll put a fix in for this in the next version of the API (2.6).
... View more
10-13-2011
09:19 AM
|
0
|
0
|
2160
|
|
POST
|
If ESRI really wants to help guys that post the problems and seek help, should tackle the issue (such as var Street = { "Single Line Input": dojo.byId("address").value}; -why it doesn't work). I'm not sure I understand. Isn't my second post in this thread outlining the specific problem and describing how to fix it? Using anything other than "Street" for the address property name will not work because the locator expects a parameter named "Street". Maybe gis_tech could provide some feedback on the answers provided in this thread?
... View more
10-13-2011
07:56 AM
|
0
|
0
|
649
|
|
POST
|
This is definitely possible and straightforward to do. Have you tried to implement it yet? As you noted, the feature layer has both onClick and onMouseOver events via the graphicsLayer. I would encourage you to try it and post back here if you run into any specific issues.
... View more
10-13-2011
07:28 AM
|
0
|
0
|
649
|
|
POST
|
True, JSON is a subset of object literal notation. But functionally, using a JSON object or creating an object via the new keyword will produce the same result. JSON does have more constraints but in the specific case outlined by gis_tech, the problem was the property name, not the syntax used to create the object.
... View more
10-13-2011
07:25 AM
|
0
|
0
|
2124
|
|
POST
|
The functionality you describe is all possible with the current release the the JS API. Buffers: http://help.arcgis.com/en/webapi/javascript/arcgis/demos/util/util_buffer.html Editing: http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ed/ed_simpletoolbar.html In the editing sample, select a template to create a new feature. Once you create a new feature, click and drag the top-center handle to rotate it. If you're already using ArcGIS Server, your easiest path and best solution will be to use the ArcGIS API for JavaScript. If you want more information about integration with OpenLayers and/or GeoExt, you're better off asking in their user forums/mailing lists.
... View more
10-13-2011
07:17 AM
|
0
|
0
|
601
|
|
POST
|
Using a border container is the recommended approach. Try starting with the "Header and Footer" layout example.
... View more
10-13-2011
07:09 AM
|
0
|
0
|
1211
|
| 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
|