|
POST
|
That fixed the content panes, but now the dom.byId isn't running its if statement. I tried it on a tablet and it will run the zoomToLocation function. The showLocation function is also running, but the IF statement is not going through when I add the code to the rest of my application. addGraphic(pt);
var option= dom.byId("selectfield");
var optionValue = option.options[option.selectedIndex].value;
console.log(optionValue);
if (option.value == "ON"){map.centerAndZoom(pt, 12);}
else {}
Am I going about this wrong? Is there a different way to toggle map.centerAndZoom?
... View more
05-16-2014
07:20 AM
|
0
|
0
|
2340
|
|
POST
|
Thanks for taking a look. This fiddle doesn't include the majority of the code just the geolocation. The code works as expected but when combine with the parser.parse(); I get the error.http://jsfiddle.net/thebillcarr/v2shP/1/
... View more
05-16-2014
04:11 AM
|
0
|
0
|
2340
|
|
POST
|
Greetings, I assume that this is a parsing issue, but I can't be for the life of me figure how. var option= dom.byId("selectfield"); var optionValue = option.options[option.selectedIndex].value; console.log(optionValue); if (optionValue == "ON"){map.centerAndZoom(pt, 12);} else {} } This is the section that is causing me grief. When I remove parser.parse(); the function runs fine. The problem is all of my title panes and content panes get thrown totally out of whack. Without it I'm getting " option.selectedIndex is undefined". I'm using this a dropdown to toggle the center and zoom of a watch ID. Anyone know what might be causing this?
... View more
05-15-2014
10:47 AM
|
0
|
12
|
3013
|
|
POST
|
Greetings, I have set up the geolocation from the Esri tutorial and it works great( with enableHighAccuracy that is), but I need the ability to toggle off and on the center and zoom so that the point is still placed, but the map can be panned without centering back on the user graphic (WatchID). function showLocation(location) {
//zoom to the users location and add a graphic
var pt = new Point(location.coords.longitude, location.coords.latitude);
if ( !graphic ) {
} else { // move the graphic if it already exists
graphic.setGeometry(pt);
}
console.log(" Fire on 3!");
addGraphic(pt);
} Has anybody accomplished this? I've tried a dozen examples for toggling but no luck. Any help is massively appreciated as I only have a small amount of hair left to pull out.
... View more
05-13-2014
10:13 AM
|
0
|
0
|
702
|
|
POST
|
Just what I was looking for. Thanks a million John!
... View more
05-12-2014
08:46 AM
|
0
|
0
|
1166
|
|
POST
|
John, Do you think you could take a second look at this? query.where = "cycle = 12";
graphic = new Graphic(pt, symbol,attr);
map.graphics.add(graphic);
featureLayer.selectFeatures(query,FeatureLayer.SELECTION_NEW);
new esri.geometry.Point(pt, map.spatialReference);
graphic.setGeometry(pt);
featureLayer.applyEdits( null,[graphic], null);
console.log(" Fire on everything!"); It is placing the graphic but not applying any edits. I'm very much new to java script, and very vexed at the moment. Did I set the query and selection up properly? Thanks.
... View more
05-12-2014
06:58 AM
|
0
|
0
|
1166
|
|
POST
|
I am attempting to pass query results to a function to update the features geometry. [HTML] function addGraphic(pt){ var symbol = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_CIRCLE, 12); graphic = new Graphic(pt, symbol,null); map.graphics.add(graphic); var query = new Query(); query.where = "OBJECTID = 1"; featureLayer.queryIds(query, function(objectIds) { //do something with the objectIds here }); new esri.geometry.Point(pt, map.spatialReference); var newFeature = new esri.Graphic(geometry, null,null); graphic.setGeometry(pt); console.log("prepare to fire"); featureLayer.applyEdits( null,[graphic], null); console.log(" Fire on everything!"); [/HTML] It runs through the console logs but comes up with a "x.attributes is null" error in the console. I haven't worked much with selectFeatures, so bare with me for any obvious mistakes. Any Ideas?
... View more
05-09-2014
08:06 AM
|
0
|
1
|
2416
|
|
POST
|
graphic = new Graphic(pt, null,null);
map.graphics.add(graphic);
query.geometry = feature.geometry;
featureLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW, function(results){
new esri.geometry.Point(pt, map.spatialReference);
graphic.setGeometry(pt);
featureLayer.applyEdits( null,[graphic], null);
console.log(" Fire on everything!");
} Bogged down in the select feature portion. Any ideas?
... View more
05-09-2014
05:48 AM
|
0
|
0
|
1166
|
|
POST
|
I have a single feature that represents a piece of machinery that needs to have it's geometry updated. I would like it to be able to be place by an input lat/lon via input text box. I was wondering what the best logic for this would entail. How would I select a single feature for geometry update? An array? Any help/guidance would be appreciated.
... View more
05-01-2014
05:02 AM
|
0
|
5
|
1576
|
|
POST
|
That got it!!! Thanks for all your help! var i = 0;
var geometry;
function addGraphic(pt){
var symbol = new SimpleMarkerSymbol(
SimpleMarkerSymbol.STYLE_CIRCLE,
12);
i++;
graphic = new Graphic(pt, symbol,attr);
map.graphics.add(graphic);
var attr = {};
attr["asdf"] = i;
new esri.geometry.Point(pt, map.spatialReference);
var newFeature = new esri.Graphic(geometry, null,null);
graphic.setAttributes(attr);
featureLayer.applyEdits([graphic], null, null);
console.log(" Fire on everything!");
... View more
04-30-2014
09:01 AM
|
0
|
0
|
1339
|
|
POST
|
I got it to add the variable (when I changed it to a stationary number), but it's not adding the sequence. var geometry;
function addGraphic(pt){
var symbol = new SimpleMarkerSymbol(
SimpleMarkerSymbol.STYLE_CIRCLE,
12);
graphic = new Graphic(pt, symbol,attr);
map.graphics.add(graphic);
var i ;
var attr = {};
attr["asdf"] ="J"+ i + 1;
new esri.geometry.Point(pt, map.spatialReference);
var newFeature = new esri.Graphic(geometry, null,null);
graphic.setAttributes(attr);
featureLayer.applyEdits([graphic], null, null);
console.log(" Fire on everything!"); Any thoughts?
... View more
04-30-2014
07:54 AM
|
0
|
0
|
1339
|
|
POST
|
I think I got it. Your field names in you additional services need to be case correct.. In your Processors layer the fields are capitalized. Try fixing those and let me know how it goes.
... View more
04-30-2014
06:47 AM
|
0
|
0
|
1973
|
|
POST
|
var i= i + 1;
var attr = {"cycle":"J"+ i};
featureLayer.applyEdits([graphic], null, attr);
console.log(" Fire on everything!"); I've been playing around with this, but it's not inputting the value. Is that even set up right? It will add the point, but no attributes.
... View more
04-30-2014
06:21 AM
|
0
|
0
|
1339
|
|
POST
|
I am attempting to add sequential numbering to newly added graphics, but I'm a little lost on logic. Would this be possible with an i = i + 1 loop? Basically I need to populate an attribute field of a feature layer with a prefix and a number (J1, J2, J3 ect.)
... View more
04-30-2014
03:59 AM
|
0
|
6
|
1453
|
|
POST
|
Your "require" and functions have to be in the same order. require([
"esri/map", "esri/layers/FeatureLayer", "esri/dijit/Legend",
"dojo/_base/array", "dojo/parser", "dojo/dom-construct", "esri/dijit/InfoWindowLite",
"esri/InfoTemplate",
"dijit/layout/BorderContainer", "dijit/layout/ContentPane",
"dijit/layout/AccordionContainer", "dojo/domReady!"
], function(
Map, FeatureLayer, Legend,
arrayUtils, parser, domConstruct, InfoWindowLite,
InfoTemplate
) {
parser.parse();
... View more
04-30-2014
03:43 AM
|
0
|
0
|
1973
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-25-2015 09:25 AM | |
| 1 | 08-26-2015 05:13 AM | |
| 1 | 08-27-2015 08:59 AM | |
| 1 | 04-13-2015 12:06 PM | |
| 1 | 02-03-2015 07:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-05-2023
04:48 PM
|