|
POST
|
You can use esri.request to get this information. Here's a sample that gets the info and writes it out to the page.
function init() {
var baseURL = "http://129.2.24.163/arcgis/rest/services";
esri.request({
url:baseURL,
content:{f:"json"},
callbackParamName:"callback",
load:getServiceDetails,
error:esriConfig.defaults.io.errorHandler
});
}
function getServiceDetails(response,args){
var info = [];
dojo.forEach(response.folders,function(folder){
info.push("Folder: " + folder + "<br/>");
});
dojo.forEach(response.services, function(service){
info.push("Service Details: " + service.name + " " + service.type + "<br/>");
});
dojo.byId('serviceDetails').innerHTML = info.join("");
}
dojo.addOnLoad(init);
... View more
09-07-2011
09:43 AM
|
0
|
0
|
2655
|
|
POST
|
setFeatures is a method available on the Popup class that allows you to associate an array of features with the popup window. In the sample a new Popup class is created and set to be the map's info window. In your code are you using the Popup class or the standard InfoWindow?
... View more
09-07-2011
07:49 AM
|
0
|
0
|
524
|
|
POST
|
I just took another look at your code and I think you are using the Flex API? If so you might want to post this question in the flex forum: http://forums.arcgis.com/forums/18-ArcGIS-API-for-Flex
... View more
08-25-2011
09:58 AM
|
0
|
0
|
1494
|
|
POST
|
Take a look at this sample: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/exp_dragdrop.html It uses the dojox.layout.ExpandoPane to allow users to hide/show a content pane. In addition I'd like it to show/hide in a east/west manner.
... View more
08-25-2011
09:55 AM
|
0
|
0
|
806
|
|
POST
|
Starting at version 2.0 of the API the input to the project method was switched from a graphic to a geometry. In your code it looks like you are attempting to project the graphic, try this instead: geometryService.project([ shpPolygon ], m_spref_Out); However, it looks like you are projecting from geographic to web mercator. If so you do not need to use project. The API contains client-side utility objects that allow you to project from geographic to web mercator and vice-versa. Here's an example: var geom = esri.geometry.geographicToWebMercator(geometryToProject); Here is a portion of the code: { // Create the spatial reference objects: m_spref_In = new SpatialReference(4326); // GCS_WGS_1984 m_spref_Out = new SpatialReference(102113); // WGS_1984_Web_Mercator shpPolygon = ac_Polygons[i_ShapeNum] // Create the graphic object: myGraphic = new Graphic(); myGraphic.geometry = shpPolygon.toPolygon(); geometryService.project([ myGraphic ], m_spref_Out); } private function projectCompleteHandler(event:GeometryServiceEvent):void { /* DEBUG */ Alert.show("#1001: event.graphics.length = " + event.graphics.length.toString()); } The event.graphics.length is ALWAYS zero.
... View more
08-25-2011
09:04 AM
|
0
|
0
|
1494
|
|
POST
|
Along with the great info Steve provided you might want to check out the 'Customize Info Window' conceptual doc in the help: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp/intro_customize.htm
... View more
08-25-2011
07:45 AM
|
0
|
0
|
1425
|
|
POST
|
You could do something like this:
var template = new esri.InfoTemplate();
template.setTitle("<b>HTML Popup Test</b>");
template.setContent("<iframe src='http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/StantonCountyKSLeases/MapServer/0/${OBJECTID}/htmlPopup?f=html' frameborder='0' width='100%' height='100%' style='width: 100%; height: 100%; display: block; padding: 0px; margin: 0px;'></iframe>");
var oilLayer = new esri.layers.FeatureLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/StantonCountyKSLeases/MapServer/0",{
infoTemplate:template
});
... View more
08-23-2011
09:03 AM
|
0
|
0
|
2003
|
|
POST
|
It looks like there may be a problem with the feature services the samples use. We are looking into it and will get the samples fixed as soon as possible.
... View more
08-23-2011
08:24 AM
|
0
|
0
|
647
|
|
POST
|
The Geolocation API is not an Esri provided API. The api is defined by the W3C Geolocation API Specification and is supported in most major browsers. You can find the specification here: http://dev.w3.org/geo/api/spec-source.html And details on how to work with the API here: http://diveintohtml5.org/geolocation.html The above link provides information on how to use the geolocation api, how to find out the accuracy of the coords and much more.
... View more
08-18-2011
03:44 PM
|
0
|
0
|
848
|
|
POST
|
The following sample shows how to populate a popup window with the results of an identify. You could modify this code to display the results of a query task instead. http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/find_popup.html If you want to display the results of multiple query task take a look at this forum discussion regarding using dojo Deferred and DeferredLists. http://forums.arcgis.com/threads/32931-How-to-use-dojo.Deferred-dojo.DeferredList-and-.then?highlight=deferredList
... View more
08-11-2011
08:15 AM
|
0
|
0
|
815
|
|
POST
|
Can you zip up your whole app and post it? Hi Kelly, I have added the missing semi-colon and checked the code you any other syntax errors, but still getting the same error, it seems to be crashing when I try to initialise the map object.
var startExtent = new esri.geometry.Extent({"xmin":480000, "ymin":131000, "xmax":544000, "ymax":176000, "spatialReference":{"wkid":27700}});
map = new esri.Map("map",{extent:startExtent, slider:true, logo:false,infoWindow:popup}); I have tried using just map = new esri.Map("map"); and still get the map will not display in IE8. Any suggestions? Many thanks David
... View more
08-11-2011
08:05 AM
|
0
|
0
|
1915
|
|
POST
|
I took a look at the image you attached to the last post - and it looks like you are editing? Is this the case? If so then its the attribute inspector that is displaying the fields in a popup. The attribute inspector doesn't have the same formatting options. View the fieldInfos section for details on how the fields can be customized in the attribute inspector. http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/attributeinspector.htm
... View more
08-10-2011
09:00 AM
|
0
|
0
|
2440
|
|
POST
|
Is the service publicly available? If so can you post the link? If the service isn't available can you post the field information (view the services directory). For example: Fields: OBJECTID_1 (Type: esriFieldTypeOID, Alias: OBJECTID_1) Shape (Type: esriFieldTypeGeometry, Alias: Shape) OBJECTID (Type: esriFieldTypeDouble, Alias: OBJECTID) NAME (Type: esriFieldTypeString, Alias: NAME, Length: 80 ) CODE (Type: esriFieldTypeDouble, Alias: CODE) NUM (Type: esriFieldTypeString, Alias: NUM, Length: 6 ) AGE (Type: esriFieldTypeString, Alias: AGE, Length: 12 ) ACODE (Type: esriFieldTypeDouble, Alias: ACODE) SLIPRATE (Type: esriFieldTypeString, Alias: SLIPRATE, Length: 7 ) SLIPCODE (Type: esriFieldTypeDouble, Alias: SLIPCODE) SLIPSENSE (Type: esriFieldTypeString, Alias: SLIPSENSE, Length: 5 ) DIPDIRECTI (Type: esriFieldTypeString, Alias: DIPDIRECTI, Length: 15 ) SLIPDIRECT (Type: esriFieldTypeString, Alias: SLIPDIRECT, Length: 5 ) FCODE (Type: esriFieldTypeDouble, Alias: FCODE) FTYPE (Type: esriFieldTypeString, Alias: FTYPE, Length: 25 ) MAPPEDSCAL (Type: esriFieldTypeString, Alias: MAPPEDSCAL, Length: 8 ) CFM_URL (Type: esriFieldTypeString, Alias: CFM_URL, Length: 254 ) Shape_Length (Type: esriFieldTypeDouble, Alias: Shape_Length)
... View more
08-10-2011
08:44 AM
|
0
|
0
|
2440
|
|
POST
|
Aaron, Here's an example showing how to use the format option with the Popup Template:
<!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, IE=9" />
<!--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>
Number Format Test
</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.4/js/dojo/dijit/themes/claro/claro.css"/>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.4/js/esri/dijit/css/Popup.css"/>
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; } .esriScalebar{
padding: 20px 20px; } #map{ padding:0;}
</style>
<script type="text/javascript">
var dojoConfig = {
parseOnLoad: true
};
</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.4">
</script>
<script type="text/javascript">
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("esri.map");
dojo.require("esri.layers.FeatureLayer");
dojo.require("esri.dijit.Popup");
var map;
var resizeTimer;
function init() {
esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer");
//setup the map's initial extent (World View)
var startExtent = new esri.geometry.Extent({"xmin":-10157363,"ymin":5563431,"xmax":-9166739,"ymax":6042844,"spatialReference":{"wkid":102100}});
//define custom popup options
var popupOptions = {
'markerSymbol': new esri.symbol.SimpleMarkerSymbol('circle', 32, null, new dojo.Color([0, 0, 0, 0.25])),
'marginLeft': '20',
'marginTop': '20'
};
//create a popup to replace the map's info window
var popup = new esri.dijit.Popup(popupOptions, dojo.create("div"));
map = new esri.Map("map", {
extent: startExtent,
infoWindow: popup
});
dojo.place(popup.domNode, map.root);
//Add the topographic 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_Topo_Map/MapServer");
map.addLayer(basemap);
//define a popup template
var popupTemplate = new esri.dijit.PopupTemplate({
title: "{NAME}",
fieldInfos: [
{fieldName: "POP2000", visible: true, label:"Population 2000",format:{places:0,digitSeparator:true}},
{fieldName: "POP2007", visible:true, label:"Population 2007" ,format:{places:0,digitSeparator:false}}
],
showAttachments:false
});
//create a feature layer based on the feature collection
var featureLayer = new esri.layers.FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
infoTemplate: popupTemplate,
outFields: ['*']
});
featureLayer.setDefinitionExpression("STATE_NAME = 'Michigan'");
//apply a renderer
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,255,255,0.35]), 1),new dojo.Color([109,146,155,0.35]));
featureLayer.setRenderer(new esri.renderer.SimpleRenderer(symbol));
dojo.connect(featureLayer,"onClick",function(evt){
map.infoWindow.setFeatures([evt.graphic]);
});
map.addLayer(featureLayer);
//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
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.ready(init);
</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 id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'"
style="border:1px solid #000;padding:0;">
</div>
</div>
</body>
</html>
... View more
08-10-2011
07:34 AM
|
0
|
0
|
2440
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-31-2026 08:27 AM | |
| 1 | 03-26-2026 09:07 AM | |
| 1 | 03-26-2026 10:11 AM | |
| 1 | 03-24-2026 02:23 PM | |
| 1 | 03-17-2026 02:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|