|
POST
|
As long as the order of the urls in the array is consistent you can use 3 formatter functions. [HTML]<th field="headeruri" width="auto" formatter="folderFormatter">Well Folder</th> <th field="headeruri" width="auto" formatter="logFormatter">Scanned Well Log</th> <th field="headeruri" width="auto" formatter="lasFormatter">LAS Data</th>[/HTML] function folderFormatter(x) { //x is the value var link = '<a href=" + x[0] + " target="_blank">Well Folder</a>'; return link; } function logFormatter(x) { //x is the value var link = '<a href=" + x[1] + " target="_blank">Well Log</a>'; return link; } function lasFormatter(x) { //x is the value var link = '<a href=" + x[2] + " target="_blank">LAS Data</a>'; return link; }
... View more
07-31-2013
11:25 AM
|
0
|
0
|
1313
|
|
POST
|
You need to use a formatter. Add the formatter param: [HTML]<th field="headeruri" width="auto" formatter="linkFormatter">Well Folder</th>[/HTML] Formatter function: function linkFormatter(x) {
//x is the value
var link = '<a href=" + x + " target="_blank">Hyperlink</a>';
return link;
} I noticed you were using the same attribute (headeruri) for 3 different columns. Do you have more than one url in an array?
... View more
07-31-2013
10:36 AM
|
0
|
0
|
1313
|
|
POST
|
Assuming you installed xampp at C:\xampp. There should be a folder C:\xampp\htdocs. Create a new folder in htdocs called 'MyApp' and copy the files there. Then in your browser go to: http://localhost/MyApp/index.html. Also you must start Apache in XAMPP Control Panel (xampp-control.exe).
... View more
07-31-2013
07:58 AM
|
0
|
0
|
743
|
|
POST
|
In general, I prefer fullExtent because some 3rd party map services are published with strange extents, e.g. zoomed way in outside the data extent. I tested this in an app and it worked fine. vmc.on('load', function() {
app.map.setExtent(vmc.initialExtent, true);
}); Is the deferred necessary? Using your code didn't work for me.
... View more
07-31-2013
07:30 AM
|
0
|
0
|
1402
|
|
POST
|
Is your web map using a basemap or otherwise setting levels of detail? The standard tiled web mercator service's highest level has a scale of approx. 1:1128, whereas the js preview in the REST api has infinite zoom. My guess is you have the labels set to not overrun the lines and your web map does not zoom to a level which they render.
... View more
07-30-2013
02:28 PM
|
0
|
0
|
783
|
|
POST
|
Ken, initialExtent is the extent of the mxd when published. Try fullExtent, which is the extent of the data. map.setExtent(layerDynamic.fullExtent, true);
... View more
07-30-2013
02:18 PM
|
0
|
0
|
1402
|
|
POST
|
GeometryServer-->Buffer only accepts one geometry type at a time. ArcMap is sorting the geometry by type, buffering and returning the buffers with the "wizard" which someone wrote to take advantage of multiple functionalities within ArcMap. To do the same in jsapi you'll need to develop the functionality yourself. Write a series of functions that: 1) check number of geometry types IF 1 GEOMETRY TYPE: 2) execute simple buffer task 3) add results to map ELSE IF 2 OR MORE GEOMETRY TYPES: 2) sort the geometry by type 3) create a deferred list of buffer tasks; one deferred for each geometry type being buffered 4) add the collective results to the map when all the tasks are complete
... View more
07-30-2013
02:07 PM
|
0
|
0
|
2577
|
|
POST
|
You can disable/enable mouse events for graphic/feature layers using the enableMouseEvents and disableMouseEvents methods. Here are the functions I call when initiating map click, draw tool activation, etc to prevent graphic selection and popups; and when said events are complete. The measure widget has the onMeasureEnd event which you could connect to enable mouse events; however there is no onMeasureStart event with which to disable mouse events.
mouseEvents: {
enable: function () {
dojo.forEach(app.map.graphicsLayerIds, function (layer) {
app.map.getLayer(layer).enableMouseEvents()
})
},
disable: function () {
dojo.forEach(app.map.graphicsLayerIds, function (layer) {
app.map.getLayer(layer).disableMouseEvents()
})
}
}
... View more
07-30-2013
10:48 AM
|
0
|
0
|
1102
|
|
POST
|
You must run an application on a web server. This won't work: file:///C:/index.html. Must be HTTP protocol. There are several development software packages out there like XAMPP http://www.apachefriends.org/en/xampp.html.
... View more
07-30-2013
10:21 AM
|
0
|
0
|
743
|
|
POST
|
It's pretty simple. Just add the related table to the map document and publish as a map service. The table will be available to query as will the ability to query related records.
... View more
07-30-2013
07:34 AM
|
0
|
0
|
891
|
|
POST
|
Getting related table data requires a separate call to the server. You'll can use esri.request() https://developers.arcgis.com/en/javascript/jsapi/namespace_esri.html#request OR use a feature layer which has the queryRelatedFeatures method https://developers.arcgis.com/en/javascript/jsapi/featurelayer.html#queryrelatedfeatures.
... View more
07-29-2013
08:25 AM
|
0
|
0
|
891
|
|
POST
|
Jeff, I use a function to return a simple table of attribute pairs. This also tests values against a URL regular expression. //generic table of attribures
attributeTable: function (atts) {
var table = '<table cellspacing="0" cellpadding="2" style="width:100%;">';
for (var i in atts) {
var value = atts;
var exp = new RegExp(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/);
if (exp.test(value)) {
value = '<a href="' + atts + '" title="' + atts + '" target="_blank">Hyperlink</a>'
}
table += '<tr><td><b>' + i + '</b></td><td>' + value + '</td></tr>';
}
table += '</table>';
return table
}
//generic use
app.utility.attributeTable(feat.attributes);
//used for content of infoWindow
it.setContent('<div style="font-size:9px;">' + app.utility.attributeTable(feat.attributes) + '</div>');
//use this one to do the same but also get field aliases for fields of a feature layer
featureAttributeTable: function (atts, feature) {
var table = '<table cellspacing="0" cellpadding="2" style="width:100%;">';
for (var i in atts) {
var alias;
dojo.forEach(feature.fields, function (field) {
if (field.name === i) {
alias = field.alias;
}
});
var value = atts;
var exp = new RegExp(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/);
if (exp.test(value)) {
value = '<a href="' + atts + '" title="' + atts + '" target="_blank">Hyperlink</a>'
}
table += '<tr><td><b>' + alias + '</b></td><td>' + value + '</td></tr>';
}
table += '</table>';
return table
}
... View more
07-25-2013
02:13 PM
|
0
|
0
|
4163
|
|
POST
|
Rob, It's strange where and geometry both return features but only geometry derived results draw. Seems like something might be up with your callback function. Try adding a an errback function to see if something is up. This will not only show errors from the server, but will also expose processing errors in the callback function which will otherwise not be logged in the console. featureLayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, HandleRouteSelectFeaturesResults, errorFunction); function errorFunction(error) {
console.log(error)
} Also, here's a list of mix ins for esri.layers.FeatureLayer modes. Saves quite a bit of space. 😉
featureLayer.selectFeatures(query, 3, callback, errback);
//feature layer modes
//MODE_SNAPSHOT:0
//MODE_ONDEMAND:1
//MODE_SELECTION:2
//SELECTION_NEW:3
//SELECTION_ADD:4
//SELECTION_SUBTRACT:5
//POPUP_NONE:"esriServerHTMLPopupTypeNone"
//POPUP_HTML_TEXT:"esriServerHTMLPopupTypeAsHTMLText"
//POPUP_URL:"esriServerHTMLPopupTypeAsURL"
... View more
07-25-2013
01:53 PM
|
0
|
0
|
1620
|
|
POST
|
//Add the marker to the map siteTemplate = new esri.InfoTemplate(title, info); /* //set attributes here */ attr = { SITE_NAME: site_name }; graphic = new esri.Graphic(point, icon, attr, siteTemplate); map.infoWindow.resize(500, 400); glayer.add(graphic);
... View more
07-25-2013
09:15 AM
|
0
|
0
|
1928
|
|
POST
|
You can also connect to the dockNode to have different click events for each dockNode. var measurefp = new dojox.layout.FloatingPane({
id: 'measure-floating-pane',
title: 'Measure',
resizable: false,
resizeAxis: null,
closable: false,
dockable: true,
dockTo: app.layout.dock,
style: 'position:absolute;top:100px;left:350px;width:160px;height:180px;visibility:hidden;overflow:hidden;',
href: 'html/measure.html',
preload: false
}, dojo.create('div', null, dojo.body()));
measurefp.startup();
measurefp.on('focus', function () {
measurefp.bringToTop();
});
measurefp.on('show', function () {
measurefp.bringToTop();
});
dojo.connect(measurefp.dockNode, 'click', function () {
app.tools.measure.clear();
});
... View more
07-23-2013
06:46 AM
|
0
|
0
|
1247
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-18-2013 06:56 AM | |
| 1 | 06-30-2015 09:17 AM | |
| 1 | 10-12-2013 07:14 AM | |
| 1 | 02-05-2014 11:05 AM | |
| 1 | 05-28-2015 11:41 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|