|
POST
|
Your page does not seem to be loading the ESRI JS API:
// Reference the ESRI JS API (add the next line before creating a map)
<script src="http://js.arcgis.com/3.9/"></script>
<script>
var map;
require([
"esri/InfoTemplate",
"esri/map",
"esri/layers/FeatureLayer",
"esri/symbols/SimpleFillSymbol",
The javascript loaded with this script contains the Dojo toolkit code as well. Not sure how this works locally without this script reference. Hope this helps, Owen Spatial XP
... View more
08-05-2014
08:02 PM
|
1
|
1
|
2592
|
|
POST
|
Do you have any raster data loaded? The Spatial Analyst toolbar appears to stay greyed out unless there is some data it can use. For example - before adding some raster data: After adding some raster data: This can be confusing as the greyed out toolbar appears exactly as it would if the extension was not enabled in Customize > Extensions.
... View more
08-04-2014
06:17 PM
|
1
|
0
|
1464
|
|
POST
|
The Geographic Conversion refers to a datum transformation. However, if both your source data and your desired projection use the same datum this is not required. This is why there is no GCS_WGS_1984 to WGS 1984 option. One issue is that your Lamberts projection file does not specify a known datum. ArcMap sees that the source data and target projection require a datum transformation but cannot locate an appropriate one. If you modify your Lamberts projection file to use WGS84 as the underlying geographic coordinate system then the project tool works as it does not require a datum transformation. However, the results may not be quite what you are after: There are other equal area world projections that use WGS84 that may be more suitable, for example: World_Behrmann (WKID: 54017 Authority: ESRI) World_Cylindrical_Equal_Area (WKID: 54034 Authority: ESRI) These are available within ArcMap (Projected Coordinate Systems > World). The list of supported map projections in the ESRI help has more information on each of these and others. As an example, the World Behrmann projected data looks like this: Melita Kennedy may be able to suggest the best projection to use. Hope this helps. Owen Spatial XP
... View more
08-04-2014
05:40 PM
|
0
|
0
|
1965
|
|
POST
|
Hi Rahul, If you resize the map to make room for your side panel then the map dimensions change (in this case the width). This will trigger a resize and a change to the map extent. If the side panel is showing when you apply your default extent using map.setExtent(), the map is forced to zoom out a little to fit the default extent within the map frame. If you are using a tiled base map you could get around this issue by using a default map center and zoom level. Owen
... View more
08-04-2014
03:22 AM
|
0
|
1
|
1414
|
|
POST
|
Hi Franky, Note that map levels are predefined scales at which tiled images are created. For example: Level Scale 1 16,000,000 2 8,000,000 3 4,000,000 4 2,000,000 etc This is important as the map level value increases as you zoom in. However, the map scale value decreases as you zoom in. To use dynamic map layers and map scale you will need to change the streetLvlZoom variable to a scale value and also update the map click and zoom-end handler functions.
var streetLvlZoom = 5000;
Also, change the way you create the map:
map = new Map("mapDiv", {
center: [151.15,-33.86],
scale:250000 // Use scale when creating the map
});
Modify the map click handler to test the map scale and not the zoom level:
// Zoom in to local area
map.on("click", function(e){
// Notice that this is now a 'greater than' test
if (map.getScale() > streetLvlZoom){
map.centerAt(e.mapPoint);
map.setScale(streetLvlZoom);
}
});
Modify the map zoom-end handler to test the map scale and not the zoom level:
// Check if draw buttons should be enabled when zoom level changes
map.on("zoom-end", function(e){
var scale = Math.floor(map.getScale())
var drawBtns = document.getElementById("draw-btns").children;
for(var i = 0; i < drawBtns.length; i++) {
// disable btns if map scale > minimum required scale
drawBtns.disabled = (scale > streetLvlZoom);
}
});
As mentioned previously the map level value increases as you zoom in. However, the map scale value decreases as you zoom in. This means that when checking to disable buttons - instead of checking if the zoom level is less than the streetLvlZoom, you need to check if the map scale is greater than the streetLvlZoom. Also, note the use of the floor function. I have noticed that when setting the map scale to 1:5000 and then checking map.getScale() you end up with a value like 1:5000:000000000704. This ends up messing with the scale > streetLvlZoom test and the buttons remain disabled. This should fix the problem where the zoom is going in the opposite direction. This modified example should work even if you also use a tiled base map with your dynamic map service layer. Example using tiled map service basemap. Example using dynamic map service basemap. Owen
... View more
08-04-2014
03:04 AM
|
1
|
1
|
1587
|
|
POST
|
Hi Franky, Check out this example that I created (based on an ESRI sample): Zoom-in Draw The key parts to do what you are after are: 1. Set the minimum zoom level to enable the draw buttons:
// Set the zoom level to enable draw buttons
var streetLvlZoom = 17;
2. Create a map click event to zoom in to a locality:
// Zoom in to local area
map.on("click", function(e){
if (map.getLevel() < streetLvlZoom){
map.centerAndZoom(e.mapPoint, streetLvlZoom)
}
});
3. When the map zoom level changes check if you should enable the draw buttons:
// Check if draw buttons should be enabled when zoom level changes
map.on("zoom-end", function(e){
var drawBtns = document.getElementById("draw-btns").children;
for(var i = 0; i < drawBtns.length; i++) {
drawBtns.disabled = (e.level < streetLvlZoom);
}
});
Hope this helps to outline the process. Owen Spatial XP
... View more
08-03-2014
06:22 PM
|
1
|
8
|
1587
|
|
POST
|
No problem Peter - can you please mark this question as answered.
... View more
08-03-2014
03:27 PM
|
0
|
0
|
631
|
|
POST
|
Also forgot to mention:
Could the problem be in line #181 "if (selection.length > 0) {"
I mean, it makes no sense for point but you would think it would work for line that do have a "length".
The selection.length in this case is the number of selected features. Length in JavaScript refers to the number of items in a list/array. This is not related to the length of line features.
... View more
08-02-2014
03:46 AM
|
1
|
4
|
2177
|
|
POST
|
One problem is that the OBJECTIDLINK field does not exist in any of the layers.
//when users click on a feature it is selected
map.on("click", function (e) {
var query = new Query();
query.geometry = e.mapPoint;
var deferred = polys.selectFeatures(query, FeatureLayer.SELECTION_NEW, function (selection) {
//update the url parameter if a feature was selected (if none were length will be 0)
if (selection.length > 0) {
// This field does not exist in the feature attributes
var feature = selection[0].attributes["OBJECTIDLINK"];
//refresh to add changes to the url, adding the url parameter
if (typeof history.pushState !== "undefined") {
window.history.pushState(null, null, "?feature=" + selection[0].attributes.OBJECTIDLINK);
}
}
});
map.infoWindow.setFeatures([deferred]);
map.infoWindow.show(e.mapPoint);
});
This leads to the new URL having an undefined value for the feature, for example: http://../CPDFN2.html?feature=undefined Owen Spatial XP
... View more
08-02-2014
03:41 AM
|
1
|
0
|
2177
|
|
POST
|
Hi Stefan, In your require list there is an issue:
"dojo/store/Memory "dojo/domReady!" // problem
The end quote and comma are missing after dojo/store/Memory. This needs to be changed to:
"dojo/store/Memory", "dojo/domReady!"
The Tundra stylesheet is also returning a 404 error. Try using: <link rel="stylesheet" href="http://js.arcgis.com/3.10/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css"> or: <link rel="stylesheet" href="http://js.arcgis.com/3.10/js/dojo/dijit/themes/tundra/tundra.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css"> After completing these changes your code populates the combo values. However, there is another issue with the way that the applyLayerDef() function is called using: <select id="mySelect" dojotype="dijit.form.ComboBox" style="width:300px;font-size:18px;" autoComplete="true" forceValidOption="false" value="Select Zoning Type" onchange="applyLayerDef(this)"></select> The new style of code creates a scoping issue in that the applyLayerDef function is not available from the HTML declared events (such as the mySelect onchange event). To get around this issue remove the onchange attribute from the select element and wire up the event within your JS code, for example:
// this replaces your applyLayerDef() function
dijit.byId("mySelect").on("change", function () {
//Filter the layer to display only the selected zoning types
var zone = dijit.byId("mySelect").value;
if (zone !== 'ALL') {
var layerDefs = [];
layerDefs[2] = "ZONING_TYPE = " + "'" + zone + "'";
layerDefs.visibleLayers = [2];
map.getLayer("dynamic").setLayerDefinitions(layerDefs);
}
else {
map.getLayer("dynamic").setDefaultLayerDefinitions();
}
});
Note that this uses the dojo/on module that will need to be included in your require list. There is a full working example I created on JS Bin you can check out. Hope this helps, Owen Spatial XP
... View more
08-01-2014
03:43 PM
|
1
|
0
|
1312
|
|
POST
|
Hi Peter, On 64-bit Win 7, the ArcMap 10.1 application is at: C:\Program Files (x86)\ArcGIS\Desktop10.1\bin\ArcMap.exe Not sure about Windows 8 but it should be very similar. Also, you should be able to locate an ArcMap *.mxd document and double click on it to launch ArcMap - try a file search for mxd documents as some are usually installed with the application.
... View more
07-31-2014
04:12 AM
|
1
|
2
|
631
|
|
POST
|
Hi Stephen, Check out this ArcGIS Server Functionality Matrix document. Web editing is through feature services:
Feature services support multiuser database editing across your intranet or the Internet.
Through this web service, you can add, delete, and update geographic features from web
browsers, mobile applications, and any REST and OGC Transactional Web Feature
Service (WFS-T) capable client.
The feature service is implemented as a stateless REST web service, providing maximum
performance and scalability. It exposes feature templates created in ArcGIS for Desktop
to clients to enable structured editing of your GIS data over the web; this gives clients an
intuitive web editing user experience.
You will need to be running the Standard or Advanced version of ArcGIS Server and you will need to have your data in a database that supports multiuser edits. The ArcGIS JS API is one of many ways to interact with ArcGIS Server. UPDATE - always confirm with your local ESRI distributor if the functionality you are after is available. TIP - check with the technical staff and not marketing/sales. Hope this helps, Owen
... View more
07-30-2014
09:23 PM
|
0
|
1
|
696
|
|
POST
|
As I notice that even the map is just initialized, the length of map.graphics.graphics is always greater than 0, since there is one point object with x,y = 0,0. Why do I get this point? I have never noticed that before. However, after running a quick test I can confirm that there is a single graphic in the graphics layer of a brand new map. Can someone at ESRI comment on this? - Jim Barry
... View more
07-30-2014
08:59 PM
|
0
|
0
|
1741
|
|
POST
|
Lukas - firstly, I would encourage you to persist with using GIS as it is such a useful tool in so many ways. In regards to the projection problem - It sounds like ArcMap does not know what coordinate system your data is in. If you view the layer properties for your data points can you check if the coordinate system: If this has not been assigned to the layer then ArcMap will not know how to project the data or do on-the-fly transformations. If this is the case the Coordinate System will show <Undefined>. You can use the Define Projection tool to assign the WGS 1984 Geographic Coordinate System to this layer (ArcToolbox: Data Management Tools > Projections and Transformations > Define Projection). After defining the projection the layer properties should have been updated: You should now be able to project your data points to S-JTSK using the Project tool (ArcToolbox: Data Management Tools > Projections and Transformations > Feature >Project):
... View more
07-30-2014
04:47 PM
|
1
|
0
|
1329
|
|
POST
|
I totally agree Jeff. The momentum shift from proprietary solutions to html/js has been huge in the past few years. Despite the issues with html/js it has a huge amount of flexibility. I just wish all browsers could just handle things in a consistent way...
... View more
07-30-2014
03:01 PM
|
0
|
4
|
1147
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-07-2014 06:13 PM | |
| 1 | 08-25-2015 02:04 AM | |
| 1 | 10-07-2014 03:54 PM | |
| 1 | 08-07-2014 09:19 PM | |
| 1 | 03-04-2015 02:02 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-21-2021
06:32 PM
|