POST
|
It will be a point on layer. The concept is to add water utility service orders to a feature layer by our service technicians (zach). From there it will go back to our server to be processed on ArcMap. We were initially going to have them place it manually with Editor, but we need more accuracy. Any ideas? var fieldAttributes = {}; fieldAttributes["tech"] = "Zach"; fieldAttributes["MeterNumber"] = 1234; . . . . var newFeature = new esri.Graphic(geometry, null, fieldAttributes); featureLayer.applyEdits([newFeature], null, null, function () {//success}, function() {//error});
... View more
04-28-2014
12:46 PM
|
0
|
0
|
1133
|
POST
|
Your help is very much appreciated, but I have one tiny, little question. How do I tie in the graphic to push the point to the feature layer? function addGraphic(pt){
var symbol = new SimpleMarkerSymbol(
SimpleMarkerSymbol.STYLE_CIRCLE,
12);
graphic = new Graphic(pt, symbol);
map.graphics.add(graphic);
// zach is feature layer
map.zach.add(graphic);
new esri.geometry.Point(pt, map.spatialReference); Pardon my incompetence, I'm transferring over from Flex. Are you talking about actually adding "graphic" on the layer?? or you mean adding point on layer?
... View more
04-28-2014
12:30 PM
|
0
|
0
|
665
|
POST
|
featureLayer.applyEdits([newFeature], null, null, function () {........});
... View more
04-28-2014
12:28 PM
|
0
|
0
|
665
|
POST
|
Is _manager your feature layer? fixed it. It is just a master js that controls everything. just ignore that.
... View more
04-28-2014
11:57 AM
|
0
|
0
|
665
|
POST
|
This is out of one of my apps function gpsPoint() {
navigator.geolocation.getCurrentPosition(function (position) {
var pt = esri.geometry.geographicToWebMercator(new esri.geometry.Point(position.coords.longitude, position.coords.latitude));
updateCollectedPoints(pt);
}, null, { enableHighAccuracy: true, maximumAge: 0, timeout: 9000 });
} updateCollectedPoints(pt) can be created like:
pointsCollected.push(pt); ///pointscollected is a global varable
geometry = new esri.geometry.Polyline(_map.spatialReference);
geometry.addPath(pointsCollected);
symbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color("red"), 5);
var graphic = new esri.Graphic(geometry, symbol);
graphic.setAttributes({ "drawtype": "collected" });
_map.graphics.add(graphic); This is copy/paste out of one of my apps, so some variables needs to be declared if you are going to use it. I am collecting points and creating a line. Also, you need html 5 to get GPS location in a browser. older ones will not support this.
... View more
04-28-2014
11:13 AM
|
0
|
0
|
665
|
POST
|
When i zoom out all the way where I can see the entire world, I get two different images from PrintTask vs print dijit. PrintTask gives me an oval (globe-like) image, while print dojit gives me a flat image. I am trying to acquire a flat image using printtask. Any ideas? Here is what I have:----- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="TestWebApp.test" %>
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Feature Layer - display results as an InfoWindow onHover</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">
<style>
html, body, #mapDiv {
padding:0;
margin:0;
height:100%;
}
#mapDiv {
position: relative;
}
</style>
<script src="http://js.arcgis.com/3.8/"></script>
<script>
var map, dialog;
require([
"esri/map", "esri/tasks/PrintTemplate", "esri/tasks/PrintParameters", "esri/tasks/PrintTask", "esri/dijit/Print"
], function (
Map, PrintTemplate, PrintParameters, PrintTask, Print
) {
map = new Map("mapDiv", {
basemap: "streets",
center: [0, 33.646],
zoom: 2,
slider: false
});
esri.config.defaults.io.proxyUrl = "/proxy.ashx";
esri.config.defaults.io.alwaysUseProxy = false;
document.getElementById("printBtn").onclick = function () {
var printTask = new esri.tasks.PrintTask("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task");
var printParams = new esri.tasks.PrintParameters();
var template = new esri.tasks.PrintTemplate();
template.layout = "MAP_ONLY"; //Tabloid ANSI B Landscape
template.format = "JPG";
printParams.map = map;
printParams.outSpatialReference = new esri.SpatialReference({ wkid: 26917 });
printParams.template = template;
printTask.execute(printParams, function (mapUrl) {
console.log('The url to the print image is : ' + mapUrl.url);
}, function (err) {
alert('error');
});
};
var printer = new Print({
map: map,
url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
}, document.getElementById("printBtn2"));
printer.startup();
});
</script>
</head>
<body class="tundra">
<div id="mapDiv">
</div>
<div id ="printBtn" style="position: absolute; left: 0; top: 0;">Print</div>
<div id ="printBtn2" style="position: absolute; left: 0; top: 20px;">Print2</div>
</body>
</html>
... View more
03-03-2014
09:37 AM
|
0
|
0
|
905
|
POST
|
I am trying to print a 24x36 pdf with several layers. The generation takes pretty good time, for obvious reasons. Seems like there is a setting somewhere by default that times it out in one minute and I get an error: "RequestTimeoutError: Timeout exceeded". Does anyone know what I need to change to increase that timeout period?
... View more
02-27-2014
04:46 AM
|
0
|
1
|
1165
|
POST
|
Apparently, it seems that it errors out on super-complex boundaries like Canada and Russia. I tired running it on simpler boundaries like some european and african countries and it seems to work fine! So basically it can generalize simple geometries but fails to do so on complex. Does that not defeats the purpose of the tool? lol 😛
... View more
02-17-2014
11:47 AM
|
0
|
0
|
450
|
POST
|
Could you double check if your web server is returning the correct mime types for the resources (.js and .css) requested by your app? This thread explains what I suspect. LiveHeader--- Contect-type info seems correct too. JS are: application/x-javascript CSS are: text/css
... View more
02-17-2014
05:44 AM
|
0
|
0
|
450
|
POST
|
Could you double check if your web server is returning the correct mime types for the resources (.js and .css) requested by your app? This thread explains what I suspect. all my css tags are like this: <link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.8/js/dojo/dijit/themes/claro/claro.css"> All js are: <script type="text/javascript" src="https://js.arcgis.com/3.8/"></script> Only other thing I have in my header is: <meta http-equiv="X-UA-Compatible" content="IE=10; IE=9; IE=8; IE=7; IE=EDGE" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.02, maximum-scale=1.0, user-scalable = no">
... View more
02-17-2014
05:35 AM
|
0
|
0
|
450
|
POST
|
I don't think so. I think that this is a issue with a resource content type. Which browser and version are you using? IE10, FF & Chrome latest.
... View more
02-17-2014
04:54 AM
|
0
|
0
|
450
|
POST
|
Could you paste your full code or provide a JSFiddle so we can better understand what's happenin Sorry, but it is huge app with more than 6000 lines of code. No way I can paste the full code. But the one I provided is the only "new code" I added. Rest has been tested and has been working fine. Do you think I have a syntax error causing it?
... View more
02-17-2014
04:38 AM
|
0
|
0
|
450
|
POST
|
I am running a query that results into a set of very complex geometries. I am trying to use the generalize tool from geometryservice https://developers.arcgis.com/javascript/jsapi/geometryservice-amd.html#generalize to generalize each of the geometries. Here is my partial code: $.each(results.features, function (_key, _val) {{
var generalizeParams = esri.tasks.GeneralizeParameters();
generalizeParams.geometries = [_val.geometry];
generalizeParams.maxDeviation = 0.05;
getGeomService().generalize(generalizeParams, function (geometries) {
_val.geometry = geometries;
}, function (err) {
});
} getGeomService() basically goes and gets the geometry service: return esri.config.defaults.geometryService; When I run this, my FireBug goes to the error function and says: SyntaxError: syntax error The resource from this URL is not text: https://js.arcgis.com/3.8/ Any idea what I am doing wrong?
... View more
02-14-2014
06:31 AM
|
0
|
8
|
868
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|