|
POST
|
This is the full code: var legendDijit = new esri.dijit.Legend({ map: map, layerInfos: layerInfo }, dojo.create('div')); dojo.create("img", {"class":"", "src": "foo.jpg"}, 'legendPanel',"last"); dojo.create("img", {"class":"", "src": "foo1.jpg"}, 'legendPanel',"last"); dojo.create("img", {"class":"", "src": "foo2.jpg"}, 'legendPanel',"last"); dojo.byId('legendPanel').appendChild(legendDijit.domNode); navigateStack('legendPanel'); if (dojo.isIE === 8) { setTimeout(function () { legendDijit.startup(); }, 100); } else { legendDijit.startup(); } Is there an easier way to incorporate the "a href" code into the dojo.create("img") or somewhere after that references each image? var a = dojo.create('a', {href: url, target: "_blank"}, 'legendPanel',"last"); dojo.create("img", {"class":"", "src": "foo.jpg"}, a); var a1 = dojo.create('a', {href: url1, target: "_blank"}, 'legendPanel',"last"); dojo.create("img", {"class":"", "src": "foo1.jpg"}, a1); var a2 = dojo.create('a', {href: url2, target: "_blank"}, 'legendPanel',"last"); dojo.create("img", {"class":"", "src": "foo2.jpg"}, a2);
... View more
06-16-2014
09:55 AM
|
0
|
0
|
2294
|
|
POST
|
amd style
var a = domConstruct.create('a', {href: links[key], target: "_blank"}, dom.byId('resultLinksTab'));
var img = domConstruct.create('img', {src: "images/" + key + ".png"}, a);
domClass.add(img, 'resultLink');
... View more
06-16-2014
09:50 AM
|
0
|
0
|
2294
|
|
POST
|
there are a few bugs associated with this. Under some circumstances, it is not currently possible solution with workaround http://support.esri.com/em/knowledgebase/techarticles/detail/41982 currently unfixed bug http://support.esri.com/en/bugs/nimbus/role/beta10_1/TklNMDk0NDMx http://forums.arcgis.com/threads/110918-javascript-Print-Secured-Service?highlight=secure+printing
... View more
06-16-2014
09:39 AM
|
1
|
1
|
2293
|
|
POST
|
How do you control whether a mapservice supports a Legend? I have that option available in both v10.0 and v10.2 mapservices. In the creation of the mapservice, I do not see an option for enabling/disabling a legend in the mapservice. its service pack 1 that enabled it i think (10.01).
... View more
06-16-2014
09:31 AM
|
0
|
0
|
3541
|
|
POST
|
I used hardcoded thumbnail urls because we support ie7. If you do not, you can use base64 img tags
... View more
06-16-2014
09:29 AM
|
0
|
0
|
3541
|
|
POST
|
there is a way. From _getLegendInfo method. if (this.rootLayer.version >= 10.01) {
url = this.rootLayer.url.replace('MapServer','MapServer/legend');
} else {
url = location.protocol+'//www.arcgis.com/sharing/tools/legend';
var i = this.rootLayer.url.toLowerCase().indexOf('/rest/');
var soap = this.rootLayer.url.substring(0, i) + this.rootLayer.url.substring(i + 5);
url = url + '?soapUrl=' + escape(soap);
} you use an else if to hardcode a json file with your own custom legend We did this on an old layer that was pure annotation that corrupted the legend So 1. Put a json file with the legend on a webserver 2. Put the path in the _getLegendInfo method so
else if(url===' http://gis.fema.gov/REST/services/FEMA/Surge/MapServer'){
url = <mywebserver>/customFEMAlegend.json
}
and customFEMAlegend.json as (sample from one of our traffic layers).
{"layers": [
{
"layerId": 0,
"layerName": "Traffic Signs",
"legend": [
{
"label": "STOP",
"url": "js/org/mymanatee/legend/images/trans-sign-stop.png"
},
{
"label": "SPEED LIMIT",
"url": "js/org/mymanatee/letragend/images/trans-sign-speed.png"
},
{
"label": "PARKING CONTROL",
"url": "js/org/mymanatee/legend/images/trans-sign-park.png"
},
{
"label": "OTHER",
"url": "js/org/mymanatee/legend/images/trans-sign-other.png"
}
]
},
{
"layerId": 1,
"layerName": "Sidewalks",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/trans-sidewalk.png"
}]
},
{
"layerId": 2,
"layerName": "School Zones",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/trans-school-zone.png"
}]
},
{
"layerId": 3,
"layerName": "Speed Zones",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/trans-speed-zone.png"
}]
},
{
"layerId": 4,
"layerName": "Crosswalks",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/trans-crosswalk.png"
}]
},
{
"layerId": 5,
"layerName": "Number of Lanes LEFT/RIGHT/CENTER/THRU/BIKE",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/trans-lanes.png"
}]
},
{
"layerId": 6,
"layerName": "Roadway Width",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/trans-.png"
}]
},
{
"layerId": 7,
"layerName": "Roadway Surface",
"legend": [{
"label": "ASPHALT",
"url": "js/org/mymanatee/legend/images/trans-roadsur-asphalt.png"
}]
},
{
"layerId": 8,
"layerName": "Guardrails",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/trans-guardrail.png"
}]
},
{
"layerId": 9,
"layerName": "Medians",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/trans-median.png"
}]
},
{
"layerId": 10,
"layerName": "Pavement Legend Locations",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/trans-pavement-legend.png"
}]
},
{
"layerId": 11,
"layerName": "Pavement Marking/Striping",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/trans-pavement-mark.png"
}]
},
{
"layerId": 12,
"layerName": "Poles",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/traff-poles.png"
}]
},
{
"layerId": 13,
"layerName": "Curbs",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/trans-curb.png"
}]
},
{
"layerId": 14,
"layerName": "Shoulders",
"legend": [{
"label": "",
"url": "js/org/mymanatee/legend/images/traff-shoulder.png"
}]
}
]}
... View more
06-16-2014
09:24 AM
|
0
|
0
|
3541
|
|
POST
|
Nliu's widget supports 10 through arcgis's legend service, but I think you need the proxy set up
... View more
06-16-2014
06:49 AM
|
0
|
0
|
3541
|
|
POST
|
The map service doesn't have a Legend page that the TOC needs to create the symbology. Compare its REST page with one of Esri's [ATTACH=CONFIG]34607[/ATTACH][ATTACH=CONFIG]34608[/ATTACH] It's 10.0, I think they need to upgrade 🙂
... View more
06-16-2014
06:43 AM
|
0
|
0
|
3541
|
|
POST
|
setTimeout is what you need. You will just have to calculate the current time, and do some math. use javascripts date object and .getMinutes() methods to get the minutes of the hour. Then use how many minutes until 15,30,45,60,0 etc to calculate how long to setTimeout.
... View more
06-13-2014
11:11 AM
|
0
|
0
|
1492
|
|
POST
|
ESRI developers have posted philosophical reasons they do not want a TOC in the API. ESRI has also been promoting "task based viewers" where every viewer is substantially different. Task based viewers are nice, but nearly every big client, company, or city wants "The Viewer". The main viewer with a standard set of tools. Or at least an easy way to add and remove from a standard set of tools. (Flex easy, not JS easy. ActionScript is nice.). One of which is a Table of Contents (TOC). I believe the majority of users do in fact understand how to use a TOC and want it. Everyone else chime in here if you have different experiences. But I believe they need to make the Basic Viewer template and the Web App Builder for JavaScript both A) easier to use B) more powerful. Our services, our servers, local API, as much (and much more) customization possible as Flex, but as easy to get started with. More out of the box widgets supplied, like TOC, Google StreetView, Multiple services Identify widget, etc. The JSON customizing in the Web Builder looks great although I wasn't getting it to work doing some tweaks on positioning scalebar, and some simple geocoder things (i.e our geocoder). I couldnt agree more. Task Based Viewers - great for simple/non developers. Nightmare to maintain, or islands that are never touched. Great simple customer experience, terrible consistency between viewers. "The Viewer" - what everyone else wants Seems like ESRI thinks these are mutually exclusive. Or at least, highly promotes one at the expense of the other. We have integrated the TOC. I would love to add right click, reorder,etc.. functionality. But for now, good enough. http://www.mymanatee.org/gisapps/mobile/index.html
... View more
06-11-2014
11:36 AM
|
0
|
0
|
2189
|
|
POST
|
I have noticed this as well but only on android. what web server are you using?
... View more
06-10-2014
09:02 AM
|
0
|
0
|
699
|
|
POST
|
i use executefor try {
task.executeForCount(q, lang.hitch(this, function(count) {
if (count > 200) {
alert('More than 200 results, please enter more specific search criteria');
} else if (count === 0) {
alert('No results');
}
else {
if(count>1){
alert("Found " + count + " results, building summary");
}
task.execute(q, lang.hitch(this, "searchCallback", result.layers, layerdesc, result.titleField));
}
}));
}
catch (err) {
console.error("onTextSearch", err);
}
... View more
06-09-2014
10:09 AM
|
0
|
0
|
862
|
|
POST
|
you have two options. Render your dynamiclayer as a Feature Layer Render your featurelayer as a Dynamic Layer With one of each, you can not control the order.
... View more
06-09-2014
10:02 AM
|
0
|
0
|
832
|
|
POST
|
oh thats not good tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Worl d_Street_Map/MapServer");
hcBasemap = new esri.layers.ArcGISTiledMapServiceLayer("http://www.blahblahblah.org/ArcGIS10/rest/services/Cache/Cache Aerials2010/MapServer", {
visible : false
});
hcBasemapDynamic = new esri.layers.ArcGISDynamicMapServiceLayer("http://www.blahblahblah.org/ArcGIS10/rest/services/Ca che/CacheAerials2010/MapServer", {
id : "Imagery_Dynamic",
minScale : 564.248588125
}); see how you have an id on your dynamic layer? you need to add one to your tiled layer
... View more
06-06-2014
11:01 AM
|
0
|
0
|
810
|
|
POST
|
try map.getLayer("layerId").show(); map.getLayer("layerId").hide(); you will have to add an id to tiledMapServiceLayer otherwise it will end up as layer_0, etc.. so
map.on('extent-change', function(delta, extent, levelChange, lods){
if(levelChange){
if(lods.level>17) {
map.getLayer("Imagery_Dynamic").show();
map.getLayer("tiledMapServiceLayerId").hide();
} else {
map.getLayer("Imagery_Dynamic").hide();
map.getLayer("tiledMapServiceLayerId").show();
}
}
});
... View more
06-06-2014
09:31 AM
|
0
|
0
|
3407
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-22-2014 08:35 AM | |
| 1 | 05-02-2012 04:56 AM | |
| 1 | 10-29-2021 07:40 AM | |
| 1 | 10-28-2021 05:26 AM | |
| 1 | 07-17-2012 08:48 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-01-2022
02:00 PM
|