POST
|
ESRI has the zoom built in the the api so you need to disable it within the function that calls the map variable and the extent (usually function init() or something similar). The disable code line is as follows: dojo.connect(map, "onLoad", function() { map.disableDoubleClickZoom(); }); Hope this helps Jaclyn
... View more
06-09-2011
01:29 PM
|
0
|
0
|
440
|
POST
|
No problem. Sorry my original post was confusing. I didn't realize they updated the samples with a new identify example.
... View more
06-08-2011
06:34 AM
|
0
|
0
|
431
|
POST
|
so for your var template: var template = new esri.InfoTemplate("", "${CONTENT_FIELD} <br/> <a href= ${URL_Field} target=_blank ;'>Click for Report!</a>"); CONTENT_FIELD = static information field URL_Field = field with URL You can change "Click for Report!" to anything
... View more
06-07-2011
02:30 PM
|
0
|
0
|
431
|
POST
|
This is a snip of code I used based on that example. You will need to change the names I used from my shapefile fields. The "reports" field in the shapefile is a url. [HTML] function layerTabContent(layerResults, layerName) { var content = ""; switch (layerName) { case "layer1results": content += "<table border='1'><tr><th>School Attending:</th><th>Date:</th><th>General Location:</th><th>Report (Will open in new window)</th></tr>"; for (var i=0, il=layerResults.features.length; i<il; i++) { content+="<tr><td>"+layerResults.features.attributes['HmSchool']+"</td>"; content+="<td>"+layerResults.features.attributes['DateText']+"</td>"; content+="<td>"+layerResults.features.attributes['Location']+"</td>"; content+="<td>"+" <a href=" + layerResults.features.attributes['Reports'] + " target=_blank ;'>Click for Report!</a></td>"; } content+="</tr></table>"; break; [/HTML] Hope this helps. Jaclyn
... View more
06-07-2011
11:53 AM
|
0
|
0
|
431
|
POST
|
Can someone help me determine why the following code won't work in IE. It works fine in Firefox.
<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<!--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>change feature layer selection color on the fly</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.2/js/dojo/dijit/themes/claro/claro.css">
<script type="text/javascript">djConfig = { parseOnLoad:true };</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.2"></script>
<script type="text/javascript">
dojo.require("esri.map");
dojo.require("esri.layers.FeatureLayer");
var selectionToolbar, featureLayer;
var syms = {}
var selectionToolbar2, featureLayer2;
var syms2 = {}
function init() {
// populate the object used to set the
// feature layer selection symbol
syms.red = new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([255,0,0,0.5]));
syms.blue = new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([0,0,255,0.5]));
syms.green = new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([0,255,0,0.5]));
syms2.red = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([255,0,0,0.5]));
syms2.blue = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([0,0,255,0.5]));
syms2.green = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([0,255,0,0.5]));
var initialExtent = new esri.geometry.Extent(-97.5328,37.4344,-97.2582,37.64041, new esri.SpatialReference({wkid:4326}) );
var map = new esri.Map("map", { extent: esri.geometry.geographicToWebMercator(initialExtent), slider: true, nav: true });
dojo.connect(map, "onLoad", initSelectToolbar);
dojo.connect(map, "onLoad", initSelectToolbar2);
var baseMapLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
map.addLayer(baseMapLayer);
var content = "<b>Status</b>: ${STATUS}" +
"<br><b>Cummulative Gas</b>: ${CUMM_GAS} MCF" +
"<br><b>Total Acres</b>: ${APPROXACRE}" +
"<br><b>Avg. Field Depth</b>: ${AVG_DEPTH} meters";
var infoTemplate = new esri.InfoTemplate("${FIELD_NAME}", content);
featureLayer = new esri.layers.FeatureLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSPetro/MapServer/1",{
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
infoTemplate: infoTemplate,
outFields: ["*"]
});
featureLayer.setDefinitionExpression("PROD_GAS='Yes'");
featureLayer.setSelectionSymbol(syms[dojo.byId('color-select').value]);
dojo.connect(featureLayer, "onSelectionClear", function(features) {
});
//*
// connect to the drop-down's onchange event and
// change the feature layer's selection color
dojo.connect(dojo.byId('color-select'), 'onchange', function(evt) {
featureLayer.setSelectionSymbol(syms[evt.target.value]);
});
//*/
map.addLayer(featureLayer);
featureLayer2 = new esri.layers.FeatureLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSPetro/MapServer/0",{
mode: esri.layers.FeatureLayer.MODE_ONDEMAND
});
featureLayer2.setDefinitionExpression("FIELD_NAME is not null");
featureLayer2.setSelectionSymbol(syms2[dojo.byId('color-select2').value]);
dojo.connect(featureLayer2, "onSelectionClear", function(features) {
});
//*
// connect to the drop-down's onchange event and
// change the feature layer's selection color
dojo.connect(dojo.byId('color-select2'), 'onchange', function(evt) {
featureLayer2.setSelectionSymbol(syms2[evt.target.value]);
});
//*/
map.addLayer(featureLayer2);
}
function initSelectToolbar(map) {
selectionToolbar = new esri.toolbars.Draw(map);
var selectQuery = new esri.tasks.Query();
dojo.connect(selectionToolbar, "onDrawEnd", function(geometry) {
selectionToolbar.deactivate();
selectQuery.geometry = geometry;
featureLayer.selectFeatures(selectQuery, esri.layers.FeatureLayer.SELECTION_ADD);
});
}
function initSelectToolbar2(map) {
selectionToolbar2 = new esri.toolbars.Draw(map);
var selectQuery2 = new esri.tasks.Query();
dojo.connect(selectionToolbar2, "onDrawEnd", function(geometry) {
selectionToolbar2.deactivate();
selectQuery2.geometry = geometry;
featureLayer2.selectFeatures(selectQuery2, esri.layers.FeatureLayer.SELECTION_ADD);
});
}
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
<select id="color-select">
<option>red</option>
<option>blue</option>
<option>green</option>
</select>
<button dojoType="dijit.form.Button" onClick="selectionToolbar.activate(esri.toolbars.Draw.EXTENT);">Select Fields</button>
<button dojoType="dijit.form.Button" onClick="featureLayer.clearSelection();">Clear Selection</button><br>
<select id="color-select2">
<option>red</option>
<option>blue</option>
<option>green</option>
</select>
<button dojoType="dijit.form.Button" onClick="selectionToolbar2.activate(esri.toolbars.Draw.EXTENT);">Select Fields</button>
<button dojoType="dijit.form.Button" onClick="featureLayer2.clearSelection();">Clear Selection</button>
<div id="map" style="position: relative; width:700px; height:500px; border:1px solid #000;"></div>
<span id="messages"></span>
</body>
</html>
The selection is working but it isn't adding color. Thanks Jaclyn
... View more
05-17-2011
09:30 AM
|
0
|
0
|
292
|
POST
|
In order to query a polygon layer based on a point would I need to setup a proxy server?
... View more
05-16-2011
01:52 PM
|
0
|
0
|
384
|
POST
|
Thank you. With a few changes this worked perfectly.
... View more
05-12-2011
09:01 AM
|
0
|
0
|
292
|
POST
|
For the following example: http://help.arcgis.com/en/webapi/javascript/arcgis/demos/fl/fl_selectfeatures.html how do you set up a graphic selector similar to this example: http://help.arcgis.com/en/webapi/javascript/arcgis/demos/graphics/graphics_add.html Basically, I want the person to be able to choose what color appears when they select the feature layer. The selection can't be based on an attribute since color selection will be determined by the person using the map and can change next time they use the map. There will be a choice of 3 colors. I've tried a few things but can't get it to work. Thanks Jaclyn
... View more
05-11-2011
02:22 PM
|
0
|
3
|
4001
|
POST
|
I am not sure if the identify function would be correct but basically I need to use an address locator to geocode a point and then depending on where that point lands information populates a side panel. I am assuming you have to pass the coordinates to an identify function but I have no idea how to do this. Basically, I want the person to enter an address, it zooms to the address and information about the area populates the side panel. The information in the side panel would come from attributes from various polygon layers on the map. Any sample codes would be appreciated. Especially how to take the geocoded result and populate a identify function with the coordinates. (Or however this is handled) Thanks Jaclyn
... View more
05-11-2011
09:58 AM
|
0
|
4
|
680
|
POST
|
I'm not super familiar with working with the Web ADF. I wasn't sure if your server was setup on .Net or Java, but here are link that should help you. Sorry I can't provide more information. http://help.arcgis.com/en/sdk/10.0/serveradf_net/conceptualhelp/index.html#/ArcGIS_Select_Buffer_Tool/000200000068000000/ http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_java_help/index.html#/NET_Web_ADF/00920000008n000000/ You might want to post in http://forums.arcgis.com/forums/10-ArcGIS-Server-Java or http://forums.arcgis.com/forums/9-ArcGIS-Server-.NET depending on how your server is setup.
... View more
02-10-2011
08:02 AM
|
0
|
0
|
510
|
POST
|
If you created the map in arcgis server manager look in C:\Inetpub\wwwroot\ArcGIS . You can find Tasks.xml in <Virtual root directory>\<ArcGIS Server instance name>\Manager\Applications\App_Data (Example: C:\Inetpub\wwwroot\ArcGIS\Manager\Applications\App_Data\Tasks.xml).
... View more
02-10-2011
07:17 AM
|
0
|
0
|
510
|
POST
|
Not that I know of. Another option for you could be to export your shapefile to a KML from Arcview and use the Javascript for Google API. You need to apply for a key from Google to publish their basemap, but the ideology is similar to the regular javascript API. Here is the Google website for the key. http://code.google.com/apis/maps/signup.html . Here is the Arcgis Google api webpage http://help.arcgis.com/EN/webapi/javascript/gmaps/help/google_samplestart.htm . There is a ton of information produced by google. I am not 100% familiar with the Google API since I never used it, but it is a free option.
... View more
02-10-2011
06:07 AM
|
0
|
0
|
262
|
POST
|
Do you already have a functioning website with a map application or are you starting from scratch and just have map services published on your server?
... View more
02-09-2011
12:34 PM
|
0
|
0
|
510
|
POST
|
I think I finally figured this out. Apparently with the graphics layers,unlike most layers, you have to wait for the map to load before adding a new GraphicsLayer. For example: you can't just have var NewGraphics NewGraphics = new esri.layers.GraphicsLayer({}); map.addLayer(NewGraphics); Instead you have to have NewGraphics = new esri.layers.GraphicsLayer({}); dojo.connect(map, "onLoad", function() { map.addLayer(NewGraphics); });
... View more
02-09-2011
12:31 PM
|
0
|
0
|
206
|
POST
|
The map id usually refers to the variable used when creating the map application. Within this "map" you have the layers and geoprocessing events. Below is an example: [PHP]var map; //Your initial variable calling the map function init() { var initExtent = new esri.geometry.Extent({"xmin":-17731,"ymin":6710077,"xmax":-12495,"ymax":6712279,"spatialReference":{"wkid":102100}}); map = new esri.Map("map",{extent:initExtent}); //Add the world street map layer to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"); map.addLayer(basemap); //resize the map when the browser resizes - view the 'Resizing and repositioning the map' section in //the following help topic for more details http://help.esri.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_guidelines.htm var resizeTimer; dojo.connect(map, 'onLoad', function(theMap) { dojo.connect(dijit.byId('map'), 'resize', function() { //resize the map if the div is resized clearTimeout(resizeTimer); resizeTimer = setTimeout( function() { map.resize(); map.reposition(); }, 500); }); }); } dojo.addOnLoad(init); </script> </head> <body class="claro"> <div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width: 100%; height: 100%; margin: 0;"> //This inserts the map into the body of your webpage <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="overflow:hidden;"> </div> </div> </body> </html>[/PHP] So your ID is what you are calling your map when you load it into the webpage. Hope this helps Jaclyn
... View more
02-09-2011
11:40 AM
|
0
|
0
|
214
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|