POST
|
here is my html <!--Toolbar--> <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'" style="background: #efefef;"> <!--Tools--> <div id="navToolbar" data-dojo-type="dijit/Toolbar" style="width: 960px; margin: 0 auto; padding: 0;"> <div data-dojo-type="dijit/form/Button" id="zoomin" data-dojo-props="iconClass:'zoominIcon'" title="Zoom In"></div> <div data-dojo-type="dijit/form/Button" id="zoomout" data-dojo-props="iconClass:'zoomoutIcon'" title="Zoom Out"></div> <div data-dojo-type="dijit/form/Button" id="pan" data-dojo-props="iconClass:'panIcon'" title="Pan"></div> <div data-dojo-type="dijit/form/Button" id="zoomfullext" data-dojo-props="iconClass:'zoomfullextIcon'" title="Full Extent"></div> <div data-dojo-type="dijit/form/Button" id="zoomprev" data-dojo-props="iconClass:'zoomprevIcon'" title="Previous Extent"></div> <div data-dojo-type="dijit/form/Button" id="zoomnext" data-dojo-props="iconClass:'zoomnextIcon'" title="Next Extent"></div> <div data-dojo-type="dijit/form/Button" id="saveMap" data-dojo-props="iconClass:'saveMapIcon'" title="Export Map"></div> <div data-dojo-type="dijit/form/Button" id="print" data-dojo-props="iconClass:'deactivateIcon'" title="Print Map"></div> <div data-dojo-type="dijit/form/Button" id="identify" data-dojo-props="iconClass:'identifyIcon'" title="Identify"></div> <div data-dojo-type="dijit/form/Button" id="intersection" data-dojo-props="iconClass:'intersectionIcon'" title="Roads Intersection" onclick="dialogIntersection.show();"></div> <div data-dojo-type="dijit/form/Button" id="removeGraphic" data-dojo-props="iconClass:'removeGraphicIcon'" title="Remove Graphics" onclick="removeGraphic();"></div> <div data-dojo-type="dijit/form/Button" id="measure" data-dojo-props="iconClass:'measureIcon'" title="Measure" onclick="(measureDialog.open) ? measureDialog.hide() : measureDialog.show();"></div> <!--About --> <div id="About" style="float: right;"> <div data-dojo-type="dijit/form/Button" id="AbouttheApp" data-dojo-props="iconClass:'aboutAppIcon'" onclick="DialogAboutApp.show();">About</div> </div> </div> </div> and the Javascript dojo.require("esri.dijit.Measurement"); dojo.require("dijit/form/CheckBox"); var dojoConfig = { parseOnLoad: true }; var measureDialog = null; var measurement = null; var wgs84; var map; var loading; require([ "esri/map", "esri/arcgis/utils", "esri/toolbars/navigation", "esri/dijit/Measurement", "dijit/registry", "dojo/on", "dojo/parser", "esri/tasks/query", "esri/layers/FeatureLayer", "esri/dijit/Legend", "esri/dijit/Geocoder", "dojo/store/Memory", "dojo/_base/array", "dojo/_base/lang", "esri/request", "dojo/json", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/form/Button", "dijit/form/ComboBox", "dojo/domReady!" ], function ( Map, utils, Navigation, Measurement, registry, on, parser, Query, FeatureLayer, Legend, Geocoder, Memory, array, lang, esriRequest, json ) { //Define Fairfield Own Base map //Define projection and start extent wgs84 = new esri.SpatialReference({ wkid: 3857 }); startExtent = new esri.geometry.Extent(-9222914.374, 4857710.818, -9154122.569, 4802412.791, wgs84); // Create map var navToolbar; map = new esri.Map("map", { extent: startExtent, nav: false, slider: true, logo:false }); //Need to define their Own proxi for the printing functionalities. esri.config.defaults.io.proxyUrl = "/proxy"; 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"); // +++ ADD MAP LAYERS: // SPECIFY THE MAP SERVICE countyMapLayer = new esri.layers.ArcGISDynamicMapServiceLayer(".../MapServer"); //20140612 // printMapLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://" + theHost + "/webadaptor/rest/services/Flex/20140616_WebPrint/MapServer"); // Valid values are png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg countyMapLayer.setImageFormat("jpg"); // ADD THE MAP SERVICE function init() { //parser.parse(); loading = dojo.byId("loadingImg"); map.addLayer(countyMapLayer); dojo.connect(map, "onUpdateStart", showLoading); dojo.connect(map, "onUpdateEnd", hideLoading); //Legend var legendLayers = []; var quakeLayer = new ArcGISDynamicMapServiceLayer(".../MapServer", { id: 'quakes' }); legendLayers.push({ layer: quakeLayer, title: 'Data' }); var Utilities = new ArcGISDynamicMapServiceLayer("...MapServer", { id: 'fire' }); map.on('layers-add-result', function () { var legend = new Legend({ map: map, layerInfos: legendLayers }, "legendDiv"); legend.startup(); }); legendLayers.push({ layer: Utilities, title: "Utilities" }); map.addLayers([Utilities, quakeLayer]); map.on('layers-add-result', function () { //add check boxes arrayUtils.forEach(legendLayers, function (layer) { var layerName = layer.title; var checkBox = new CheckBox({ name: "checkBox" + layer.layer.id, value: layer.layer.id, checked: layer.layer.visible }); checkBox.on("change", function () { var targetLayer = map.getLayer(this.value); targetLayer.setVisibility(!targetLayer.visible); this.checked = targetLayer.visible; }); //add the check box and label to the toc domConstruct.place(checkBox.domNode, dom.byId("toggle"), "after"); var checkLabel = domConstruct.create('label', { 'for': checkBox.name, innerHTML: layerName }, checkBox.domNode, "after"); domConstruct.place("<br />", checkLabel, "after"); }); }); //measurement try { measureDialog = dijit.byId("dialogMeasurement"); measurement = new esri.dijit.Measurement({ map: map }, dojo.byId('measurementDiv')); measurement.startup(); measureDialog.startup(); } catch (ex) { alert(ex.toString()); } function removeGraphic() { alert("No grpahic found on the map"); } //ToolBar navToolbar = new Navigation(map); on(navToolbar, "onExtentHistoryChange", extentHistoryChangeHandler); registry.byId("zoomin").on("click", function () { navToolbar.activate(Navigation.ZOOM_IN); }); }
... View more
09-12-2014
06:23 AM
|
0
|
4
|
554
|
POST
|
I have this code for the Zoom in function and it does not work.
//ToolBar
navToolbar = new Navigation(map);
on(navToolbar, "onExtentHistoryChange", extentHistoryChangeHandler);
registry.byId("zoomin").on("click", function () {
navToolbar.activate(Navigation.ZOOM_IN);
});
I have all the references...any idea?
... View more
09-11-2014
08:54 PM
|
0
|
6
|
2469
|
POST
|
I'd like the idea of placing the measurement widget inside the dijit/Dialog so that when the user clicks on the measure button in a toolbar then show the measurement. but the inconvenient here is that the dijit/Dialog is opened as modal popup. is there a way to have a dijit/Dialog not in a modal mode so that we can still interact with the map? here is what I mean:
... View more
09-11-2014
01:42 PM
|
0
|
1
|
724
|
POST
|
Thank you Robert the link was very helpful. But, now I am having a little issue. In my case, I have 3 comboboxes populated from 3 different layers and I would like to use the same function (app ={ zoomRow: }) for all 3 comboboxes. I thought about using the switch case depending on the ComboBox id but no success. is there a way around this?
... View more
09-11-2014
12:18 PM
|
0
|
1
|
914
|
POST
|
I am trying to add a map Service layer on Esri basemap and no success. I am wondering if it is possible to do so?
... View more
09-10-2014
10:01 PM
|
0
|
3
|
3021
|
POST
|
I would like to populate field attributes in dojo combobox and zoom to the selected feature on selected Index changed. any way to achieve this?
... View more
09-10-2014
05:09 PM
|
0
|
3
|
4263
|
POST
|
I changed the outspatialReference to map.spatialReference and it's working fine. Thank you Robert...
... View more
08-25-2014
09:40 AM
|
0
|
0
|
590
|
POST
|
Thank you Robert for your reply, Yes, I do get to that line and even go all the way to the bottom and show the results of parcels Ids within the buffer but not highlighting those parcels on the map! Could that outSpatialReference on a query could be the problem?
... View more
08-25-2014
08:39 AM
|
0
|
2
|
590
|
POST
|
Hi all, In my code I am trying to buffer a parcel and then highlight the parcels that interesect the buffer. the code works fine for the buffer and add the first graphic on the map. but after performing the query to add the second graphic, it won't work. I am not sure why! here is my code:
// Listen for GeometryService onBufferComplete event
dojo.connect(gsvc, "onBufferComplete", function(graphics) {
var symbol = new esri.symbol.SimpleFillSymbol("none", new esri.symbol.SimpleLineSymbol("solid", new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.25]));
var graphic = new esri.Graphic(graphics[0], symbol);
map.graphics.add(graphic); // this one works fine...
query.geometry = graphic.geometry;
query.outSpatialReference = {"wkid":3754};
queryTask.execute(query);
map.setExtent(map.graphics.graphics[0].geometry.getExtent().expand(1.25));
});
// +++++Listen for QueryTask executecomplete event+++++
dojo.connect(queryTask, "onComplete", function(fset) {
dojo.byId('ResultsGoHere').innerHTML = " ";
var resultFeatures = fset.features;
var symbol = new esri.symbol.SimpleFillSymbol(
"solid",
new esri.symbol.SimpleLineSymbol(
"none",
new dojo.Color([0, 0, 255, 0.65]), 2),
new dojo.Color([255, 0, 255, 0.35]));
var noOfPolys = resultFeatures.length;
var graphic2, i;
// run this for loop to highlight the parcels
for (i = 0; i < noOfPolys; i++) {
graphic2 = new esri.Graphic(resultFeatures.geometry, symbol);
map.graphics.add(graphic2); //here no graphics added to the map;
}
}
... View more
08-25-2014
07:01 AM
|
1
|
4
|
1198
|
POST
|
I created a custom tool that outputs an Info table on Disc C:\temp. Now I would to retrieve 2 fields and display the data in a list view from that table.
... View more
07-28-2014
09:44 AM
|
0
|
1
|
2205
|
POST
|
I am looking for the code behind the Identify Tool in Arc Map. The particular reason is the fact that the tool can access any type of layer's fields in TOC (Table of content) such as map services, WMS layers. For my case, instead of displaying all the data, I just want to retrieve one value.
... View more
07-28-2014
06:49 AM
|
0
|
1
|
2216
|
POST
|
I am trying to find a better method of accessing fields within a published map service. My first approach was to convert the Map Service to a feature layer then to a feature class but no success. The service was published to allow data querying. The Find Tool in ArcMap does the job as image shown bellow but I would like to be able to access those fields. My goal is to be able to retrieve an information by clicking on the feature. Sounds like the Identify tool.
... View more
07-26-2014
08:02 PM
|
0
|
0
|
2947
|
POST
|
Thank you Hornbydd , Well, I am looking for that different approach. How do you call the summarize field command? what is the syntax for it? I do not seem to find it anywhere on the forum. I do think that would be the best way to do it but just don't know how!
... View more
05-28-2014
09:51 AM
|
0
|
0
|
540
|
POST
|
Thank you for your reply, I moved the line above the DoWhile as you mentioned but still taking a while about 1minute. The layer I am testing this tool on has about 6000 features.
... View more
05-16-2014
05:49 AM
|
0
|
0
|
540
|
Title | Kudos | Posted |
---|---|---|
2 | 06-27-2023 09:06 PM | |
1 | 12-17-2021 08:58 AM | |
3 | 12-17-2021 09:37 AM | |
1 | 05-03-2021 08:47 AM | |
1 | 08-08-2015 03:35 PM |
Online Status |
Offline
|
Date Last Visited |
06-28-2023
06:10 AM
|