|
POST
|
Here's a quick sample. Hopefully this helps.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; 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>Build your first application</title>
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/esri/css/esri.css">
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dijit/themes/claro/claro.css" />
<style type="text/css">
html, body, #map {
padding: 0;
margin: 0;
height: 100%;
}
</style>
<script src="http://js.arcgis.com/3.7/"></script>
<script>
var map;
require(["esri/map", "dojo/ready", "dojo/on", "esri/geometry/Polyline", "esri/graphic", "esri/symbols/SimpleLineSymbol", "dojo/domReady!"], function(Map, ready, on, Polyline, Graphic, SimpleLineSymbol) {
var map = new Map("map", {
center: [-122.67, 45.54], //longitude, latitude
zoom: 12,
basemap: "streets",
slider: true, //default
sliderPosition: "top-left" //default
});
ready(function (){
on(map, "load", drawPath);
function drawPath(){
var polylineJson = { "paths":[[[-122.68,45.53], [-122.58,45.55], [-122.57,45.58],[-122.53,45.6]]], "spatialReference":{"wkid":4326}};
var polyline = new Polyline(polylineJson);
var polylineSymbol = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 3);
var g = new Graphic(polyline, polylineSymbol, null, null);
map.graphics.add(g);
}
});
});
</script>
</head>
<body class="claro">
<div id="map"></div>
</body>
</html>
... View more
01-03-2014
06:54 AM
|
0
|
0
|
1960
|
|
POST
|
http://dojotoolkit.org/reference-guide/1.9/dojo/store/JsonRest.html https://dojotoolkit.org/documentation/tutorials/1.7/store_driven_grid/ http://dojofoundation.org/packages/dgrid/tutorials/grids_and_stores/ These links have all the information you seek. Let me know if you have any other questions. (P.S. I highly recommend using dgrid)
... View more
01-02-2014
12:26 PM
|
0
|
1
|
1051
|
|
POST
|
Could you create an example using http://jsfiddle.net/ ?
... View more
12-30-2013
09:31 AM
|
0
|
0
|
1102
|
|
POST
|
Thanks so much for sharing! Going to take a look at this today 😃 +1
... View more
12-20-2013
09:14 AM
|
0
|
0
|
683
|
|
POST
|
I'm not seeing any code that makes reference to those modules. I'm not sure that's advice for sohnem2. Thank you for your valuable contribution to this thread; we both appreciate it.
... View more
12-19-2013
05:42 AM
|
0
|
0
|
2871
|
|
POST
|
The variable names in the function have to be in the same order as modules in the require (which they appear to be in this case), but the modules loaded in the require part don't necessarily need a variable name in the function. These just have to come after the last module with a variable name. I believe you need a variable name in the function if you intend to invoke the module directly in code (which sohnem2 did, as apparent by his code). Do you have any advice for sohnem2, Ken?
... View more
12-19-2013
04:51 AM
|
0
|
0
|
2871
|
|
POST
|
I think it probably has to do with either your dojoConfig object, or the inclusion order of your script files. Try loading all of your scripts in the <head>, rather than some in the <body> as you have now. Also, make sure your dojoConfig object is properly set (especially since you are using the legacy style of dojo, rather than the preferred AMD style). Lastly, check this page from stackoverflow for more details: http://stackoverflow.com/questions/2850314/jquery-dojo-how-do-i-use-jquery-with-dojo-toolkit
... View more
12-18-2013
12:11 PM
|
0
|
0
|
2371
|
|
POST
|
Your dependencies aren't loaded in the correct order. For example, you attempt to load "esri/arcgis/utils", "dojo/parser" and "dojo/ready" but there's no variable assignment in the following function. Also, is there a particular reason you have this bit of code: require(["dojo"], function (dojo) {
dojo.addOnLoad(
function () {
require([...
... View more
12-18-2013
09:39 AM
|
0
|
0
|
2871
|
|
POST
|
Have you've been able to fix this issue? What issue are you having dhunink? This is quite an old post and several versions of the JSAPI have come out since.
... View more
12-18-2013
07:13 AM
|
0
|
0
|
2371
|
|
POST
|
So I have a search function that populates the a Datagrid through it's data store and a manual selection tool that adds or removes items from the grid. Items are added with: data_store.newItem(data); The add function places the new items at the end of the grid. I would like this new entry to populate the new item at the top of the grid. Since I am using the data store and not an array, I can't use a function like unshift to place at the beginning of the array. I thought I had seen someone on these forums solve this before, but I can't find the post. Ideas anyone? Have you tried using sort based on a predictable property? If you don't have a great property to sort on, you could have a hidden property that acts as a sorting mechanism for new items added to the store. All older items might have sort=1, while items you've added to the store recently have sort=0, and you'd sort your store based on that hidden field. Last question, have you tried using dgrid over datagrid? It's far far easier to use and included in the ESRI JSAPI.
... View more
12-18-2013
07:08 AM
|
0
|
0
|
779
|
|
POST
|
Yes, you are able to use the same data set to generate both points on a map and graphs with d3. There probably isn't an example using both ESRI JSAPI & D3 specifically but if you check out the documentation, you will be able to hook them up to the same data source.
... View more
12-18-2013
06:48 AM
|
0
|
0
|
926
|
|
POST
|
The background color for the Popup/infoWindow looks to be set in esri.css. You should be able to use CSS to change the background color. Using the color red for this example...
.esriPopup .contentPane {
background-color: #FF0000 !important;
}
.esriPopup .actionsPane {
background-color: #FF0000 !important;
}
There may be an easier way using javascript but this is the CSS way.
... View more
12-11-2013
01:25 PM
|
0
|
0
|
652
|
|
POST
|
Your dependancies are in the wrong order: "esri/map", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "esri/dijit/InfoWindowLite", "esri/InfoTemplate", "esri/layers/FeatureLayer", "dojo/dom-construct", "esri/dijit/OverviewMap", "esri/dijit/Scalebar", "dojo/parser", "dojo/domReady!" ], function ( Map, InfoWindowLite, InfoTemplate, FeatureLayer, domConstruct, OverviewMap, Scalebar, parser ) { Change to: "esri/map", "esri/dijit/InfoWindowLite", "esri/InfoTemplate", "esri/layers/FeatureLayer", "dojo/dom-construct", "esri/dijit/OverviewMap", "esri/dijit/Scalebar", "dojo/parser", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!" ], function ( Map, InfoWindowLite, InfoTemplate, FeatureLayer, domConstruct, OverviewMap, Scalebar, parser ) {
... View more
12-11-2013
11:42 AM
|
0
|
0
|
2646
|
|
POST
|
Hey Tracy, I can take a look at your application now. While I do that, if you don't mind me asking, why didn't the forEach loop work? What is qTaskNameList exactly as far as structure goes? Does this not loop the same number of times as qTaskNameList.length?
... View more
11-26-2013
08:37 AM
|
0
|
0
|
2144
|
|
POST
|
Try something like:
function exportGridCSV() {
qTaskNameList.forEach(function(gridName){
var gridData = registry.byId(gridName+"_grid");
//code to that takes the data from the grid, creates an output string called inputData;
submitCSVPrint (gridName, inputData);
});
}
Another example, this is a loop I use that removes graphics from my graphicsLayer based on the type attribute
this.graphicsLayer.graphics.forEach(lang.hitch(this, function (g) {
if (g.attributes) {
if (g.attributes.type === i18n.customLabel) {
this.graphicsLayer.remove(g);
}
}
}));
... View more
11-26-2013
07:55 AM
|
0
|
0
|
2144
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-26-2014 09:56 AM | |
| 1 | 09-18-2014 11:50 AM | |
| 1 | 09-19-2014 11:28 AM | |
| 1 | 07-09-2014 01:43 PM | |
| 1 | 07-09-2014 02:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
08-14-2024
05:31 PM
|