POST
|
Visual Studio 2012 should recognize the "data-" attributes, though. Provided it's validating against the HTML5 schema, either force it through the validation settings or let it choose the schema automatically by specifying the correct DOCTYPE.
... View more
01-03-2013
11:07 AM
|
0
|
0
|
195
|
POST
|
This thread is getting pretty long and also it looks like it's diverging into separate issues - might soon be time to start new threads for those individual issues. I think your original question was answered some time ago 🙂 I've changed all layers to use the layerToggle method, but am having trouble with the DynamicMapServiceLayer. FeatureLayers work just fine. What sort of trouble? I need some FeatureLayers that have infoWindows, and some DynamicMapServiceLayers that have labels. (there may be a way to avoid this that I am overlooking). You could use image-based layers (e.g. dynamic or tiled) for everything then use something like the IdentifyTask to retrieve attributes for display in an InfoWindow and there are some samples for this. Involves a round-trip per Identify operation though, depends on your needs etc. The DynamicMapServiceLayer, called 'boundaries' has an array of layerIDs that are integers from the service REST definition. These are carried over to the HTML checkbox that uses layerToggle. So for layerID = 1, I'm just using layerToggle(['1']). However, when debugging, the layerIDs gets defined, but unlike with the supermarkets that works, the layer does not get defined during the layerToggle method. I'm stumped. 'boundaries' is a single layer...and you're not providing it with a layerId upon instantiation so the API auto-assigns one:
var imageParameters = new esri.layers.ImageParameters();
imageParameters.layerIds = [0,1,12,13,14,15,16,17,18,19,20,21,22,23];
//You were also missing a ; from the end of the following line:
imageParameters.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW; //can also be: LAYER_OPTION_EXCLUDE, LAYER_OPTION_SHOW, LAYER_OPTION_INCLUDE
boundaries = new esri.layers.ArcGISDynamicMapServiceLayer(mapservice+"/MapServer", {"imageParameters":imageParameters}); Those layerIds are not any use for client-side referencing, their purpose is to be sent back to the server so that the (single) image generated contains only features from the layers in the service that are in that list. The docs have both DynamicMapServiceLayer and FeatureLayer parts well defined, but not the interaction between them. The problem seems to be using both addLayer and addLayers. I'm using addLayer for the DynamicMapServiceLayer, and it is working fine. I'm using addLayers for FeatureLayer, and it works fine. The two seem conflicted however. All are added in a single JS function, in the order I want, but all the FeatureLayers are drawn above (after) the DynamicMapServiceLayer. Any thoughts before I try overriding? From the docs: Also, all graphics layers are always on top of TiledMapServiceLayers and DynamicMapServiceLayers.
... View more
12-06-2012
02:31 AM
|
0
|
0
|
157
|
POST
|
AHAAAA! I GOT IT! It WAS a CSS thing. Twitter bootstrap was overriding a style!!! Thank you for all the help!!! Worth marking one of the replies as the answer then? 😉
... View more
11-27-2012
06:15 AM
|
0
|
0
|
888
|
POST
|
I sincerely thanks your help with my question and had solved my problem. You're welcome, please mark as answer next to the post that helped you. This forum is lucky to have a person like yourself. *blushes* 🙂
... View more
11-27-2012
04:21 AM
|
0
|
0
|
594
|
POST
|
tags please!
//combo box item
function populateList(results) {
//Populate the dropdown list box with unique values
//alert("sss: "+results.length);
var zone;
var values = [];
var testVals={};
//Add option to display all zoning types to the dropdown list
//values.push({name:"ALL"})
var features = results.features;
//values.push({name:'ALL'});
dojo.forEach (features, function(feature) {
zone = feature.attributes.TOPIC;
if (!testVals[zone]) {
testVals[zone] = true;
values.push({name:zone});
}
});
var dataItems = {
identifier: 'name',
label: 'name',
items: values
};
var store = new dojo.data.ItemFileReadStore({data:dataItems});
dijit.byId("mySelect").store = store;
values.push({name:"ALL"})
}
... View more
11-27-2012
03:42 AM
|
0
|
0
|
405
|
POST
|
Short answer - no. You might try and put some proprietary obfuscation/encryption in place I suppose if it's a real problem, otherwise general web security patterns apply.
... View more
11-27-2012
01:35 AM
|
0
|
0
|
180
|
POST
|
The end result is the same no matter whether use the word "interpret" or "support". Po-tay-to, po-tah-to as far as I'm concerned. It doesn't work. With programming, in general, it does matter, details matter...otherwise you end up spending time barking up wrong trees etc. Or just plain old "doing it wrong". There's a difference between a bug and stated functionality. Do you know if it continues to be an issue with the newer version of IE? GIYF...but but it would appear that MS claim it does - http://msdn.microsoft.com/en-gb/library/ie/ff974773(v=vs.85).aspx You could always try it for yourself, should take all of 30 seconds 🙂
... View more
11-27-2012
01:13 AM
|
0
|
0
|
421
|
POST
|
Posting the code, rather than pictures of the results, would probably be more useful...
... View more
11-27-2012
12:18 AM
|
0
|
0
|
405
|
POST
|
I am struggling with the use of this layerToggle([array]); You just need to pass it an array of strings where each string is the Id of a layer in the map. I have four layers that work: Convenience Stores, CSAs, Farmstands, and Farmers' Markets. The rest of the layers using layerToggle, including Supermarkets, Roads and Cities , do not work. I added a little bit to the code on bold/red below:
function layerToggle(layerIds) {
//Could use dojo.forEach here if you prefer
for (var i = 0; i < layerIds.length; i++) {
var layer = map.getLayer(layerIds);
if (layer) {
//Set the layer's visibility to NOT its current visibility
layer.setVisibility(!layer.visible);
}
else {
alert("layer [" + layerIds + "] not found");
}
}
//checkLayerState();
}
It's only a dirty/temporary bit of code to illustrate what's going wrong, don't leave it in when you go live, perhaps substitute the alert for a console.warn or something. Anyway, the problem is you are passing, for example, 'supermarket1' and 'supermarket2' to the layerToggle function but in your JS file you're giving those layers Ids of 'superMarket1' and 'superMarket2' respectively - spot the difference? (clue: JS is case-sensitive) I haven't gone through all the other layers - I'll leave that for you to do, that alert should help 🙂 I'm using updateLayerVisibility() to toggle some layers that have one layerID per checkbox, so don't let that confuse you. That is not quite working either. I'd use the same function to toggle all layers, that way you only have one path through and if you have a bug you only have to fix it in one place etc. etc. (good programming practice) You can just pass the layerToggle method an array of 1 Id e.g. ['superMarket1'] I wonder if you have any input for me on the drawing order on the map. I want the first 7 layers to draw first, below the stores and boundaries and roads, etc. Layers are drawn in the order that you add them to the map, you can override that by passing a desired layer index to the addLayer method, addLayers doesn't have the specific index argument (it adds the layers in the order of the array that you pass) but you can re-order layers afterwards - probably best to consult the documentation/samples.
... View more
11-27-2012
12:13 AM
|
0
|
0
|
521
|
POST
|
Seconded You can use the voting tools on the right-hand side of each post to up-vote stuff you agree with 🙂
... View more
11-26-2012
11:52 PM
|
0
|
0
|
888
|
POST
|
Please wrap your code snippets in tags.
//Declare this at the global scope
var myGlobalVariable;
function countfeat(type,select) {
var selectedOption=select.options[select.selectedIndex];
query = new esri.tasks.Query();
query.where = type + " Like '%" + selectedOption.value + "%'";
queryTask = new esri.tasks.QueryTask("http://vdid-gisedn-2:8399/arcgis/rest/services/flow_BRID/MapServer/0");
queryTask.executeForCount(query, function(count){
alert(count); //it works here with a correct number returned
//Yes, and this is where you assign the value to your variable, but you can only use the value AFTER this has been done
alert("myGlobalVariable = " + myGlobalVariable); //Will have a value of undefined the first time this runs, thereafter will have the previous value...unless you clear it between calls
myGlobalVariable = count;
alert("myGlobalVariable = " + myGlobalVariable); //Will now have the value of count
});
};
//Hook this function up to a button, it will allow you to check the value of the global variable
function testValue(){
alert("myGlobalVariable = " + myGlobalVariable); //This will show undefined until the callback of executeForCount has run
}
I really think you'd benefit from investing some time learning some of the fundamentals of JavaScript (and programming concepts in general) things like scope, closures, asynchronous patterns etc. etc. Here's a start on the JS stuff: https://developer.mozilla.org/en-US/docs/JavaScript/Guide
... View more
11-26-2012
11:48 PM
|
0
|
0
|
594
|
POST
|
Unfortunately, I cannot connect to the element within the popup via ID or Class. Any thoughts? What's not working? (what have you tried?)
... View more
11-26-2012
11:41 PM
|
0
|
0
|
333
|
POST
|
Have you got some CSS defined somewhere that might be hiding it? Or are you missing some CSS? Use some development tools e.g. firebug (in FF) or the built-in tools in other browsers to examine the element. If your site is publicly available then perhaps post a link?
... View more
11-26-2012
10:38 AM
|
1
|
0
|
888
|
POST
|
The effort required to upgrade our application, which I would suggest is reasonably complex/customised etc. was pretty much the square root of zero. To put it another way, I'd get a second opinion. I suppose it is possible that you might be dealing with something really special or perhaps written in an obscure way, I'm sure there's a consultant out there who could help the dev team out...for a fee...
... View more
11-26-2012
10:33 AM
|
0
|
0
|
455
|
Title | Kudos | Posted |
---|---|---|
1 | 11-26-2012 10:38 AM | |
1 | 10-17-2012 06:29 AM | |
1 | 08-03-2012 07:42 AM |
Online Status |
Offline
|
Date Last Visited |
01-10-2023
02:01 PM
|