|
POST
|
Here is the code to Add Links inside the infoWindow: if (dojo.byId("MyLink") == undefined) { dojo.create("a", { "id": "MyLink", "class": "action", "innerHTML": "Edit", "onclick": "MyLinkAction();return false;" }, dojo.query(".actionList", map.infoWindow.domNode)[0]); }
... View more
10-28-2014
01:57 PM
|
0
|
2
|
891
|
|
POST
|
When viewing my feature server service in ArcGIS.com Map I get the Edit link in the info window as image bellow, but in my App, the Edit link is not showing up. is there a way to activate it?
... View more
10-28-2014
07:35 AM
|
0
|
3
|
4398
|
|
POST
|
I am using API 3.10 and I am trying to Activate Editor on Button Click and deactivate the Edit when the button is clicked again. on page Page Load I set the EditContent Pane css to display none and display it on button click. Also calling InitEditor on button click does not seem to work, the editor is not loading neither the TemplatePicker not event the Editor InfoTemplate. here is my code:
appEdit = {
showEditPanel: function () {
var node = registry.byId("btnEditLayer");
var panel = dojo.byId("EditContent");
var value = node.get("label");
if (value == "Start Edit") {
domStyle.set(registry.byId("EditContent").domNode, { 'display': 'block' });
registry.byId("mainWindow").resize();
node.set("label", "Stop Edit");
initEditor();
}
else if (value == "Stop Edit") {
domStyle.set(registry.byId("EditContent").domNode, { 'display': 'none' });
registry.byId("mainWindow").resize();
node.set("label", "Start Edit");
destroyEditor();
}
}
}
here are the functions InitEditor and DestroyEditor
function initEditor(evt) {
var templatePicker = new TemplatePicker({
featureLayers: [permit, sitePlan],
grouping: true,
rows: "auto",
columns: 3
}, "templateDiv");
templatePicker.startup();
var layers = arrayUtils.map(evt.layers, function (result) {
return { featureLayer: result.layer };
});
var settings = {
map: map,
templatePicker: templatePicker,
layerInfos: layers,
toolbarVisible: true,
createOptions: {
polylineDrawTools: [esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYLINE],
polygonDrawTools: [esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYGON]
},
toolbarOptions: {
reshapeVisible: true
}
};
var params = { settings: settings };
var myEditor = new Editor(params, 'editorDiv');
//define snapping options
var symbol = new SimpleMarkerSymbol(
SimpleMarkerSymbol.STYLE_CROSS,
15,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([255, 0, 0, 0.5]),
5
),
null
);
map.enableSnapping({
snapPointSymbol: symbol,
tolerance: 20,
snapKey: keys.ALT
});
myEditor.startup();
}
function destroyEditor() {
if (editorWidget) {
editorWidget.destroy();
editorWidget = null;
}
}
... View more
10-28-2014
07:23 AM
|
0
|
1
|
1332
|
|
POST
|
Hi Jake, I am looking for a similar scenario but your link is not working for me.
... View more
10-23-2014
09:34 AM
|
0
|
0
|
3503
|
|
POST
|
You can set the width and the height of the infoWindow using map.infoWindow.resize(width, height);
... View more
10-08-2014
05:42 AM
|
0
|
0
|
474
|
|
POST
|
Hi Ken, I am trying to implement this TOC widget in my APP but I am having issue with the path in visual studio. I am wondering how you set up your path... I have the folder css in my Application: and in my default page I have this script <script type="text/javascript"> var dojoConfig = { paths: { //if you want to host on your own server, download and put in folders then use path like: agsjs: location.pathname.replace(/\/[^/]+$/, '') + '/src/agsjs' } }; </script> here is the error I am getting
... View more
10-02-2014
02:10 PM
|
0
|
1
|
4180
|
|
POST
|
So, I downloaded the folder and added to my project. Also, I have the css linked. it is not working for me still. Am I missing something? <link href="agsjs/css/agsjs.css" rel="stylesheet" /> <script src="http://js.arcgis.com/3.10/"></script> <script type="text/javascript"> var dojoConfig = { paths: { //if you want to host on your own server, download and put in folders then use path like: agsjs: location.pathname.replace(/\/[^/]+$/, '') + '../agsjs' } }; </script> and here is the script: // begin add the legend map.on('layers-add-result', function(evt){ // overwrite the default visibility of service. // TOC will honor the overwritten value. // dynaLayer1.setVisibleLayers([2, 5, 8, 11]); try{ toc = new agsjs.dijit.TOC({ map: map, layerInfos: [{ layer: utilitiesLayer, title: "Utilities" }, { layer: roads, title: "Roads" //collapsed: false, // whether this root layer should be collapsed initially, default false. //slider: false // whether to display a transparency slider. }] }, 'legendDiv'); toc.startup(); } catch(ex){ alert(ex.toString()); } })
... View more
10-01-2014
02:47 PM
|
0
|
1
|
2521
|
|
POST
|
Thank you Tim, This link is implementing the TOC dijit using "agsjs/dijit/TOC". I am having an error with it in 3.10. The page is not showing me the error but I now that name space is the problem. I have to say, this is a great widget. I hope I'll make it work
... View more
10-01-2014
01:27 PM
|
0
|
3
|
2521
|
|
POST
|
Most samples and examples I have seen so far only display the legend and check-boxes separately within different tabs. Is there a way to have them together instead of switching tabs all the time to go toggle layers on or off as image bellow ?
... View more
10-01-2014
12:05 PM
|
0
|
9
|
3892
|
|
POST
|
Thank you Ken for replying... I tried what you said and it did not work. I also tried to change identifyParams.geometry = point; line 16 above but still nothing.
... View more
09-25-2014
09:45 AM
|
0
|
0
|
612
|
|
POST
|
I have the code below that shows the info window on map click. I would like to call the same function in the gridRowClick event.
function identifyPOI(evt) {
var measureMode = dojo.query(".esriButton .dijitButtonNode").some(function (node, index, arr) {
if (node.childNodes[0].checked) {
//at least one of the measure tools is active so disable identify
return true;
}
});
if (!measureMode) {
var identify = new esri.tasks.IdentifyTask(".../MapServer");
var identifyParams = new esri.tasks.IdentifyParameters();
identifyParams.geometry = evt.mapPoint;
identifyParams.mapExtent = map.extent;
identifyParams.returnGeometry = true;
identifyParams.tolerance = 3;
map.infoWindow.clearFeatures();
//Define a good infoTemplate
var infoTemplateUtilities = new esri.InfoTemplate();
infoTemplateUtilities.setTitle("FacilityID: <br/> <b>${Facility Identifier}</b>");
infoTemplateUtilities.setContent("Open file: <b> <a href='Documentation/${MAPREF}.pdf' target='_blank'> ${MAPREF} </a> </b><br/>" +
"Install Date: <b>${Install Date} </b><br/>" +
"Material: <b>${Material}</b><br/>" +
"Diameter: <b>${Diameter}</b> <br/>" +
"Status: <b>${Status}</b> <br/>" +
"Last Update Date: <b>${Last Update Date}</b> <br/>" +
"Water Type: <b>${Water Type}</b> <br/>" +
"Lenght(ft): <b>${SHAPE_Length}</b> <br/>");
try {
identify.execute(identifyParams, function (results) {
map.infoWindow.setFeatures(dojo.map(results, function (result) {
var feature = result.feature;
feature.setInfoTemplate(infoTemplateUtilities);
return feature;
}));
map.infoWindow.show(evt.mapPoint);
});
}
catch (ex) {
alert(ex.toString());
}
}
};
function onRowClickHandler(evt) {
var clickedUtilityId = grid.getItem(evt.rowIndex).OBJECTID;
var selectedUtility;
dojo.forEach(map.graphics.graphics, function (graphic) {
if ((graphic.attributes) && graphic.attributes.OBJECTID === clickedUtilityId) {
selectedUtility = graphic.geometry;
return;
}
});
var thePoly = selectedUtility;
var theExtent = thePoly.getExtent();
map.setExtent(theExtent, true);
//and display the infoWindow
var utilityLenght = thePoly.paths[0].length;
if(utilityLenght % 2 !=0){
utilityLenght = utilityLenght - 1;
var pointXY = thePoly.paths[0][(utilityLenght / 2)];
var infoPoint = new esri.geometry.Point(pointXY[0], pointXY[1], new esri.spatialReference({ wkid: 102723 }));
try{
identifyPOI(evt.infoPoint); //<==== here is where I am not sure...
}
catch (ex) {
alert(ex.toString());
}
}
};
the image below is the final result I am trying to achieve.
... View more
09-25-2014
08:12 AM
|
0
|
3
|
2540
|
|
POST
|
Thank you all, the problem was the legacy. changed to var infoTemplateUtilities = new esri.InfoTemplate(); and it worked.
... View more
09-24-2014
09:44 AM
|
0
|
0
|
280
|
|
POST
|
here is the infoTemplate I want to use: //Define a good infoTemplate var infoTemplateUtilities = new InfoTemplate(); infoTemplateUtilities.setTitle("Facility: <b>${FACILITYID}</b>"); infoTemplateUtilities.setContent("MAPREF NUMBER : <b>${MAPREF}</b><br/>" + "<b>Install Date: </b>${INSTALLDATE}<br/><br/>" + "<b>Material: </b>${MATERIAL}<br/>" + "<b>Diameter: </b>${DIAMETER}"); try { identify.execute(identifyParams, function (results) { map.infoWindow.setFeatures(dojo.map(results, function (result) { var feature = result.feature; feature.setInfoTemplate(infoTemplateUtilities); //feature.setInfoTemplate(new esri.InfoTemplate()); return feature; })); map.infoWindow.show(evt.mapPoint); }); } catch (ex) { alert(ex.toString()); } and here is the Default info Template
... View more
09-24-2014
09:10 AM
|
0
|
0
|
2167
|
|
POST
|
I am also wondering if the number of fields to show could be the issue? because when using the default method feature.setInfoTemplate(new esri.InfoTemplate()); it shows all the fields in the info window.
... View more
09-24-2014
08:42 AM
|
0
|
2
|
2167
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-12-2024 07:03 AM | |
| 1 | 12-11-2024 02:20 PM | |
| 2 | 06-27-2023 09:06 PM | |
| 1 | 12-17-2021 08:58 AM | |
| 3 | 12-17-2021 09:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
12-12-2024
05:34 PM
|