POST
|
Robert I never would have thought that the position of domReady was the problem, but now I know that. I got it to work fine with adding the proxy to config.json. Thank you very much for your help. /Mathias
... View more
11-10-2015
03:24 PM
|
0
|
0
|
868
|
POST
|
Hi Robert, thank you very much it works now I can see you moved "dojo/domReady! to the end of the define list. Was this what caused my problem? But if I want to access xml documents from at different domain I still need the line esriConfig.defaults.io.proxyUrl = "/PHP_proxy/proxy.php"; If I remove the line I get the error: "esri.config.defaults.io.proxyUrl is not set. If making a request to a CORS enabled server, please push the domain into esri.config.defaults.io.corsEnabledServers". You mentioned that WAB takes care of this for me, but not in my case. Should I some where in other Web AppBuilder files configure this? /Mathias
... View more
11-09-2015
03:34 PM
|
0
|
2
|
868
|
POST
|
Hello, can anyone guide me in a direction on how to use the esriRequest function in a Web Appbuilder Widget? I have just started using Web AppBuilder Developer Edition. I started with extending the sample widget Demo with a button Widget.html: <div>
<button id="gotoPosition" data-dojo-type="dijit/form/Button" type="button" data-dojo-attach-point="gotoPosition">Go to position</button>
</div> I then extended the onOpen: function() in widget.js to zoom to a position ...
onOpen: function(){
console.log('onOpen');
var map = this.map;
var Long, Lat;
var LocPoint, point;
//Go to position
on(this.gotoPosition, 'click', lang.hitch(this, function(evt){
console.log('gotoPosition 2');
map.graphics.clear();
Lat = 55;
Long = 15;
LocPoint = new Point([Long,Lat]);
map.centerAndZoom(LocPoint,17);
}));
},
... From Access data (XML) | ArcGIS API for JavaScript I found out how to use esriRequest and from Using the proxy | Guide | ArcGIS API for JavaScript how to install the proxy and finally putting it all together in one HTML file (esriRequest_xml.html) which works fine. <!DOCTYPE html>
<html>
<head>
<title>XML Content</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
<script src="http://js.arcgis.com/3.13/"></script>
<script>
require(["dojo/dom", "dojo/on", "dojo/dom-class", "dojo/_base/json", "dojox/xml/parser", "esri/config", "esri/request", "dojo/domReady!"], function(dom, on, domClass, dojoJson, xmlParser, esriConfig, esriRequest) {
console.log('ok')
esriConfig.defaults.io.proxyUrl = "/PHP_proxy/proxy.php";
var url = "url to a xml docement";
var requestHandle = esriRequest({
"url": url,
"handleAs": "xml"
});
requestHandle.then(requestSucceeded, requestFailed);
function requestSucceeded(response, io){
document.write("Succes");
//do something with the xml data
}
function requestFailed(error, io){
document.write("Fail");
}
});
</script>
</head>
<body>
</body>
</html> I then tried to put the javascript code from esriRequest_xml.html into the onOpen: function() but this resulted in the error "Uncaught TypeError: Cannot read property 'io' of undefined" Maybe because of wrong scope?, but don't know how to fix this. Can anyone guide me how to get esriRequest to work?
... View more
11-09-2015
02:09 PM
|
0
|
4
|
5065
|
POST
|
With versioned SDE data in an Oracle database I use: edit.startEditing(False, True) with unversioned SDE data in an Oracle database I use edit.startEditing(False, False) these settings work for me
... View more
10-19-2014
08:22 AM
|
0
|
0
|
3142
|
POST
|
In a python script I'm trying to save a graph to a .png file with graph output from arcpy.StackProfile_3d but the .png file shows an empty graph. The table created from arcpy.StackProfile_3d shows values. Does anybody know why the graph is still empty? import arcpy # Set Local Variables profileLine = "C:/temp/data.gdb/profile" profileTargets = "C:/temp/data.gdb/raster" profileTable = "C:/temp/value.dbf" graphName = "Sample Graph" outGraph = "C:/temp/graph.png" # Execute StackProfile arcpy.StackProfile_3d(profileLine, profileTargets, profileTable, graphName) # # Execute SaveGraph arcpy.SaveGraph_management(graphName, outGraph, "MAINTAIN_ASPECT_RATIO") [ATTACH=CONFIG]32624[/ATTACH]
... View more
03-30-2014
04:03 AM
|
0
|
1
|
2559
|
POST
|
These lines will add a layer with SP10.1: mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] addLayer = arcpy.mapping.Layer(r'G:\data_layers\political\Towns_Maine_polys.lyr') arcpy.mapping.AddLayer(df, addLayer, "AUTO_ARRANGE") but if you try other things like using the Layer.replaceDataSource method the layer will disappear again. I have not tried all methods/properties combinations but they might fail as well as some of you have experienced. /Mathias
... View more
03-26-2014
05:11 AM
|
0
|
0
|
203
|
POST
|
A Newtonian mechanics approach could be used to account for the speed of a bicycle moving down a slope. Speed of a bike when only considering the degree of the slope and the initial speed of bike is: v�?� =sin�? a�??t +a�?�t +v0 Where v�?� is the speed at the time t, �? the degree of the hill, a�?? the gravitational acceleration on the Earth, a�?� the acceleration from the bicyclist and v0 the speed at the time t = 0. The interesting part here is that the speed of the bicycle is dependent of the speed at a previous position on the slope. Therefore will a bicyclist after riding down a hill have a larger speed at the bottom than at the top of the hill, this complicates the estimation of the travel time since the resistance from the wind is dependent of the speed of the bike. This means that it will be necessary to calculate the influence from the hill based on many different initial speeds to get an accurate value. One solution could be just to use an average initial value as speed of the bike. In either case it is necessary to develop an algorithm based on newton mechanics which then could be used with a DTM model to precalculate hills costs for the different edges in a network which then would be used as all other types of network costs applied to the edges. An algorithm was not develop in the project we were writing on but it should be possible with an outset in v�?� =sin�? a�??t +a�?�t +v0 and an average speed of a bicyclist in flat terrain to make a estimate for the resistance from the terrain. This will not be 100% perfect but should give a useable approximation.
... View more
07-31-2012
04:30 AM
|
0
|
0
|
149
|
POST
|
Sorry for the late response but I first saw your post now. Yes it is not an easy task to find the �??fastest path�?� when considering hills. We would also like to estimate the time it takes to bike the path, and the problem here is that the gravitational force is constant, which means that the speed of a bike going down a hill will be a lot faster at the bottom than at the top of the hill. But we will post a summary of our final solution in the beginning of June. Thanks for the link to your abstract, is your paper �??Calibrating a Transportation Network with Terrain Information for Routing Applications�?� published and is it possible to read it?
... View more
05-14-2012
03:49 AM
|
0
|
0
|
922
|
POST
|
Funny how small the world is. I will give your regards to him and thanks again for your help /Mathias Kofoed Poulsen
... View more
04-24-2012
01:18 PM
|
0
|
0
|
922
|
POST
|
Thank you again Jay your answers have been very helpful 🙂 By the way do you know Thomas Balstrøm from Denmark? He is one of the teachers from University of Aalborg where I�??m studying Geoinformatics.
... View more
04-24-2012
07:00 AM
|
0
|
0
|
922
|
POST
|
OK, thank you Jay. I only know how to assign a cost to an edge that will be the same going from A to B and B to A, and not like in this case different going from A to B (uphill) and B to A (downhill) but I guess it must be possible, I will try to look into that.
... View more
04-23-2012
01:19 PM
|
0
|
0
|
922
|
POST
|
Hello In the Path Distance tool I would like to use my own vertical-factor graph instead of the predefined ones. Is the only way to do this using the table option or is there some way to use my own graph expressions directly so I don't have to write a line for every degree I want to include? /Mathias
... View more
04-23-2012
06:42 AM
|
0
|
2
|
467
|
POST
|
Hello I'am trying to calculate the fastest route for biking between two points, the fastest route should take into account that it is faster to bike downhill than uphill. I know that it is possible to do this on raster data with Spatial Analyst Path Distance tool but does anybody know if it is possible to it with a Network Analyst tool with a network? /Mathias
... View more
04-23-2012
06:22 AM
|
0
|
10
|
4475
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|