|
POST
|
What about if you add the layers to the map using map.addLayers([array of layers to add]). Then you could listen for the 'onLayersAddResult' event which fires after all the layers have been added.
... View more
11-07-2011
09:23 AM
|
0
|
0
|
1085
|
|
POST
|
There isn't - but we are looking at adding events to the IdentityManager. "Is there an onSuccessLogin type event that i can listen for to trigger my refresh"
... View more
11-07-2011
08:48 AM
|
0
|
0
|
1085
|
|
POST
|
Ken, The templates available in the template gallery were all built using the ArcGIS API for JavaScript so the functionality for creating a new map based on a web map id is not going to go away. As jstreeb pointed out you can visit the web api help pages for details on building completely custom applications. Here's an example of a simple layout built using the ArcGIS API for JavaScript that has minimal styling. This layout works with a web map from ArcGIS.com. To view the layout with different web maps replace the value for webmap in the code with your web map id. The 'sections' of this layout were created using Dojo's layout widgets - you can read about the layout widgets here: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_dojoLayouts.htm View application running here: http://jsfiddle.net/khutchins/sXPTE/1/embedded/result/ And here's the code:
<!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>
</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/dojo/dijit/themes/Nihilo/Nihilo.css">
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/esri/dijit/css/Popup.css">
<style type="text/css">
html,body {
height:100%;
width:100%;
margin:0;
padding:0;
}
body {
overflow:hidden;
}
#header {
height:55px;
}
#footer {
height:30px;
}
#rightPane {
width:20%;
}
#leftPane {
width:150px;
}
</style>
<script type="text/javascript">
var dojoConfig = {
parseOnLoad: true
};
</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5">
</script>
<script type="text/javascript">
dojo.require("dijit.dijit"); // optimize: load dijit layer
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.AccordionContainer");
dojo.require("esri.IdentityManager");
dojo.require("esri.map");
dojo.require("esri.arcgis.utils");
var map;
function init() {
var urlObject = esri.urlToObject(document.location.href);
var webmap = "59357ba9bd06409a99c0eb89f9089a40";
if (urlObject.query) {
webmap = urlObject.query.webmap;
}
var mapDeferred = esri.arcgis.utils.createMap(webmap, "map", {
mapOptions: {
slider: true
},
geometryServiceURL: "http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
});
mapDeferred.addCallback(function(response) {
map = response.map;
//resize the map when the browser resizes
dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
});
mapDeferred.addErrback(function(error) {
console.log("Map creation failed: ", dojo.toJson(error));
});
}
//show map on load
dojo.addOnLoad(init);
</script>
</head>
<body class="nihilo">
<div id="mainWindow" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline'"
style="width:100%; height:100%;">
<div id="header" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
<div id="title">
Title goes here
</div>
<div id="subtitle">
Sub title goes here
</div>
</div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'left'" id="leftPane">
<div data-dojo-type="dijit.layout.AccordionContainer">
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'pane 1'">
Content for pane 1
</div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'pane 2'">
<p>
Content for pane 2
</p>
</div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'pane 3'">
<p>
Content for pane 3
</p>
</div>
</div>
</div>
<div id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
</div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'right'" id="rightPane">
This is the right section
</div>
<div id="footer" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'">
This is the footer section
</div>
</div>
</body>
</html>
... View more
11-04-2011
04:02 PM
|
0
|
0
|
755
|
|
POST
|
Identity Manager is a singleton class that is automatically instantiated into esri.id when you load the module into your application. When you sign in using the identity manager the credentials are stored in esri.id.credentials. So if you need access to the token you can do something like this:
console.log(esri.id.credentials[0].token);
... View more
11-04-2011
01:07 PM
|
0
|
0
|
1085
|
|
POST
|
It doesn't look like you can modify the snap tolerance. The parameters used by the to find the route can be specified using the route parameters class in the JavaScript api and there is not an option for specifying the snap tolerance. http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/routeparameters.htm I am using this network service in my application. http://tasks.arcgisonline.com/ArcGIS/rest/services/NetworkAnalysis/ESRI_Route_EU/NAServer/Route I need to pass some bridges as barriers to the route, but I would like to change the snap distance of the route layer. Is it possible to do it with javascript and the rest api? If it was my own service I would change the option in arcgis, but I don't know how to do it with an ESRi service I am quite new to the whole subject thanks in advance Emilia Fiorini
... View more
11-04-2011
12:55 PM
|
0
|
0
|
964
|
|
POST
|
Patrick, Thanks for reporting this issue. We are working to fix this for the next release of the ArcGIS API for JavaScript.
... View more
11-03-2011
02:24 PM
|
0
|
0
|
2038
|
|
POST
|
Many of the widgets document the css classes that are available in the API reference. For example here's a link to the Attribute Inspector widget API doc - note that it has a CSS section with some doc: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/attributeinspector.htm The easiest way to see the styles associated with a widget is to use either Chrome Developer tools or Firebug to inspect the application at run time. You can use these tools to view the styles and stylesheets. Here's some inf on using Firebug's CSS tab: http://getfirebug.com/css
... View more
11-03-2011
10:45 AM
|
0
|
0
|
1004
|
|
POST
|
The Overview Map constructor options allow you to specify the color of the fill rectangle. You can define a fill and border color to use for the extent rectangle. Setting the color works if you want to change the default color of the extent rectangle. However in your case it sounds like you want a border but not a fill color. If so you can accomplish this using css, her'es a style that sets the border to a dark green color and the fill to transparent:
.esriOverviewMap .ovwHighlight {
border: solid 2px #004F00 !important;
background-color: transparent !important;
}
Here's a working demo that shows the above style in action: http://jsfiddle.net/tR4RE/
... View more
11-03-2011
09:19 AM
|
0
|
0
|
1004
|
|
POST
|
I just ran a quick test on the Android using this developer sample and it worked ok for me: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/find_popup.html One thing you might try is to increase the IdentifyParameters tolerance. The tolerance defines the distances from the input geometry (mouse click) that should be used to perform the identify.
identifyParams = new esri.tasks.IdentifyParameters();
identifyParams.tolerance = 3;
identifyParams.returnGeometry = true;
... View more
11-01-2011
06:54 AM
|
0
|
0
|
576
|
|
POST
|
The default tolerance used to be 5 which was did cause difficulties when clicking on Android but now its 15 which in my testing seems to be fine. I created a quick page and was able to successfully display info windows on an older Android phone ( Motorola Droid with Android 2.2.2). http://servicesbeta.esri.com/mobile/androidtest.html
... View more
10-29-2011
02:23 PM
|
0
|
0
|
1951
|
|
POST
|
Its hard to know what's happening without seeing more code. Is your service public? If so can you create a test case that shows the problem?
... View more
10-26-2011
10:26 AM
|
0
|
0
|
2100
|
|
POST
|
The problem is that when you destroy the measurement widget the measuremntDiv is destroyed too. So when you try to recreate the measurement widget that div no longer exists. Instead of using an existing div you can create a new div to hold the measurement widget and add that to the measurementDiv. Here's an example: <!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>
Measure Tool
</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/dojo/dijit/themes/claro/claro.css">
<style type="text/css">
html,body {
height:100%;
width:100%;
margin:0;
}
body {
background-color:#FFF;
overflow:hidden;
font-family:"Trebuchet MS";
}
#map {
border:solid 2px #808775;
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius:4px;
margin:5px;
padding:0px;
}
#titlePane{
width:240px;
}
.claro .dijitTitlePaneTitle {
background: #808775;
font-weight:600;
border:solid 1px #29201A;
}
.claro .dijitTitlePaneTitleHover {
background:#808775;
}
.claro .dijitTitlePaneTitleActive {
background:#808775;
}
.claro .dijitTitlePaneContentOuter {
border-right: solid 2px #808775 !important;
border-bottom: solid 2px #808775 !important;
border-left: solid 2px #808775 !important;
}
</style>
<script type="text/javascript">
djConfig = {
parseOnLoad:true
};
</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5"></script>
<script type="text/javascript">
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.TitlePane");
dojo.require("dijit.form.CheckBox");
dojo.require("esri.map");
dojo.require("esri.dijit.Measurement");
dojo.require("esri.SnappingManager");
dojo.require("esri.dijit.Scalebar");
dojo.require("esri.layers.FeatureLayer");
var map;
var measurement;
function init() {
//This sample may require a proxy page to handle communications with the ArcGIS Server services. You will need to
//replace the url below with the location of a proxy on your machine. See the 'Using the proxy page' help topic
//for details on setting up a proxy page.
esri.config.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx";
esri.config.defaults.io.alwaysUseProxy = false;
//This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications
esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
var initialExtent = new esri.geometry.Extent({"xmin":-9545482,"ymin":4615382,"xmax":-9544248,"ymax":4616059,"spatialReference":{"wkid":102100}});
map = new esri.Map("map", {
extent:initialExtent
});
dojo.connect(map, 'onLoad', function(map) {
//resize the map when the browser resizes
dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
});
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer");
map.addLayer(basemap);
var sfs = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new dojo.Color([195,176,23]), 2),null);
var parcelsLayer = new esri.layers.FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/MapServer/0", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
parcelsLayer.setRenderer(new esri.renderer.SimpleRenderer(sfs));
dojo.connect(map, "onLayersAddResult", function(results){
//dojo.keys.copyKey maps to CTRL on windows and Cmd on Mac.
var snapManager = map.enableSnapping({snapKey:dojo.keys.copyKey});
var layerInfos = [{layer: parcelsLayer}];
snapManager.setLayerInfos(layerInfos);
createMeasure();
});
map.addLayers([parcelsLayer]);
}
//show map on load
dojo.addOnLoad(init);
function tglMeasurementOff() {
measurement.destroy();
}
function tglMeasurementOn() {
createMeasure();
}
function createMeasure(){
measurement = new esri.dijit.Measurement({
map: map
}, dojo.create('measure'));
dojo.place(measurement.domNode,dojo.byId('measurementDiv'));
measurement.startup();
measurement.setTool("distance", true);
}
</script>
</head>
<body class="claro">
<div id="mainWindow" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline',gutters:'false'"
style="width:100%; height:100%;">
<div id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
<button id="tglMeasurementOff" type="button" onclick="tglMeasurementOff();">toogleMeasurementOff</button>
<button id="tglMeasurementOn" type="button" onclick="tglMeasurementOn();">toogleMeasurementOn</button>
<div style="position:absolute; right:20px; top:10px; z-Index:999;">
<div id="titlePane" data-dojo-type="dijit.TitlePane" data-dojo-props="title:'Measurement', closable:'false', open:'false'">
<div id="measurementDiv"></div>
<span style="font-size:smaller;padding:5px 5px;">Press <b>CTRL</b> to enable snapping.</span>
</div>
</div>
</div>
</div>
</body>
</html>
... View more
10-25-2011
11:29 AM
|
0
|
1
|
1370
|
|
POST
|
Is query in lower case in your dojo.require statement, for example: dojo.require("esri.tasks.query"); Also have you checked either Firebug or Chrome Developer Tools to see if there are any error messages?
... View more
10-24-2011
10:24 AM
|
0
|
0
|
2100
|
|
POST
|
Sounds like you are running into this issue - if so try increasing the tolerance. http://forums.arcgis.com/threads/30061-Android-Click-on-Graphic-Problem?p=100747#post100747
... View more
10-19-2011
03:43 PM
|
0
|
0
|
1951
|
|
POST
|
There's a typo in your code that adds the parking info: change the all lowercase outfields to mixed case (outFields) outfields: ["*"], outFields: ["*"],
... View more
10-18-2011
09:42 AM
|
0
|
0
|
866
|
| 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 |
Online
|
| Date Last Visited |
10 hours ago
|