|
POST
|
Did you try what Kelly suggested in an earlier post?
... View more
04-09-2014
08:20 AM
|
2
|
0
|
3256
|
|
POST
|
You could check the ArcObjects API, but the .NET version is really impossible to find anything unless you are willing to click on every tree node in every namespace. <sarcasm>Let's see, if I don't know what I'm looking for, perhaps it might be in the carto namespace, but maybe in A? or B? or C? Maybe it's cartoUI, but is it IA, or IB? or.. a list would be nice... </sarcasm> This is one reason I am using H3Viewer to browse through all the help documentation. [ATTACH=CONFIG]32957[/ATTACH]
... View more
04-09-2014
08:02 AM
|
0
|
0
|
3587
|
|
POST
|
In this example, I added an id to the KMLLayer and if the layer has that id, I change the layer name. <!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>RssToggle</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 {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
margin: 0;
padding: 0;
}
#metaLegend {
position: absolute;
left: 20px;
bottom: 20px;
width: 20em;
height: 5em;
z-index: 40;
background: #fff;
color: #777;
padding: 5px;
border: 2px solid #666;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
font-family: arial;
font-size: 0.9em;
}
#metaLegend h3 {
color: #666;
font-size: 1.1em;
padding: 0px;
margin: 0px;
display: inline-block;
}
#metac {
position: absolute;
left: 20px;
bottom: 20px;
width: 20em;
height: 5em;
z-index: 40;
background: #fff;
color: #777;
padding: 5px;
border: 2px solid #666;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
font-family: arial;
font-size: 0.9em;
}
#metac h3 {
color: #666;
font-size: 1.1em;
padding: 0px;
margin: 0px;
display: inline-block;
}
legendDiv {
display: none;
}
</style>
<script src="http://js.arcgis.com/3.8/"></script>
<script>
var map;
require([
"esri/map",
"esri/layers/KMLLayer",
"esri/layers/GeoRSSLayer",
"esri/InfoTemplate",
"dojo/parser",
"esri/layers/FeatureLayer",
"dojo/_base/array",
"esri/symbols/PictureMarkerSymbol",
"esri/renderers/SimpleRenderer",
"esri/dijit/Legend",
"dijit/form/CheckBox", "dojo/dom", "dojo/dom-construct",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojo/domReady!"
], function (
Map, KMLLayer, GeoRSSLayer, InfoTemplate,
parser, FeatureLayer, array, PictureMarkerSymbol, SimpleRenderer, Legend, CheckBox, dom, domConstruct
) {
map = new esri.Map("map", {
basemap: "oceans",
center: [-122.399, 37.78],
zoom: 9
});
// create layout dijits
parser.parse();
var kmlUrl = "http://dl.dropbox.com/u/2654618/kml/Wyoming.kml";
var kml = new KMLLayer(kmlUrl, {
id: "KML"
});
var cities = new FeatureLayer(
"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0", {
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
// var georssUrl = "http://geocommons.com/overlays/116926.atom"; // S.F. and East Bay Breweries http://geocommons.com/overlays/116926
var georss = new GeoRSSLayer("http://geocommons.com/overlays/116926.atom");
georss.on("load", function () {
//domStyle.set("loading", "display", "none");
// create an info template
var template = new InfoTemplate("${address}", "${zip}");
// set the info template for the feature layers that make up the GeoRSS layer
// the GeoRSS layer contains one feature layer for each geometry type
var layers = georss.getFeatureLayers();
var picRenderer = new PictureMarkerSymbol("http://static.arcgis.com/images/Symbols/Basic/RedShinyPin.png", 21, 21);
var georssRenderer = new SimpleRenderer(picRenderer);
array.forEach(layers, function (l) {
l.setInfoTemplate(template);
l.setRenderer(georssRenderer)
});
});
///////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//add the legend
map.on("layers-add-result", function (evt) {
var layerInfo = array.map(evt.layers, function (layer,
index) {
return {
layer: layer.layer,
title: layer.layer.name
};
});
if (layerInfo.length > 0) {
var legendDijit = new Legend({
map: map,
layerInfos: layerInfo
}, "legendDiv");
legendDijit.startup();
}
//add check boxes
array.forEach(layerInfo,
function (layer) {
var layerName = layer.title;
if (layer.layer.id === "KML") { layerName = "KML Layer";}
var checkBox = new CheckBox({
name: "checkBox" + layer.layer.id,
value: layer.layer.id,
checked: layer.layer.visible,
onChange: function (evt) {
var clayer = map.getLayer(this.value);
clayer.setVisibility(!clayer.visible);
this.checked = clayer.visible;
}
});
//add the check box and label to the TOC
domConstruct.place(checkBox.domNode, "toggle",
"after");
var checkLabel = domConstruct.create('label', {
'for': checkBox.name,
innerHTML: layerName
}, checkBox.domNode, "after");
domConstruct.place("<br />", checkLabel,
"after");
});
});
map.addLayers([georss, cities, kml]);
});
</script>
</head>
<body class="tundra">
<div data-dojo-type="dijit/layout/BorderContainer"
data-dojo-props="design:'headline',gutters:false"
style="width: 100%; height: 100%; margin: 0;">
<div id="map"
data-dojo-type="dijit/layout/ContentPane"
data-dojo-props="region:'center'">
<div id="metaLegend" style="display: none;">
<h3>Legend</h3>
<br>
<div id="legendDiv"></div>
</div>
<div id="metac">
<h3>Layers</h3>
<br>
<div id="toggle" style="padding: 2px 2px;"></div>
</div>
</div>
</div>
</div>
</body>
</html>
... View more
04-09-2014
07:51 AM
|
0
|
0
|
1389
|
|
POST
|
Glad to help. Don't forget to click the check to mark the question as answered. This will help others in searching on this topic.
... View more
04-09-2014
05:50 AM
|
0
|
0
|
1022
|
|
POST
|
Two things. I'm surprised it's not complaining about the fact that you're calling BufferTool function like this BufferTool(); with the function requiring the variable "map" to be passed into it. Why are you adding in another map click listener with BufferClick? BufferClick = app.map.on("click", function(evt){ //define input buffer parameters var params = new BufferParameters(); params.geometries = [ evt.mapPoint ]; params.distances = [ 10 ]; params.unit = GeometryService.UNIT_STATUTE_MILE; geometryService.buffer(params); }); Why not set these parameters where you are initializing the event listener action2?
... View more
04-08-2014
01:52 PM
|
0
|
0
|
5028
|
|
POST
|
This should work <!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>Overview Map</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
</style>
<script src="http://js.arcgis.com/3.9/"></script>
<script>
var map;
require([
"esri/map", "esri/dijit/OverviewMap",
"dojo/parser",
"dojo/i18n!esri/nls/jsapi",
"dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!"
], function (
Map, OverviewMap,
parser, esriBundle
) {
parser.parse();
map = new Map("map", {
basemap: "topo",
center: [-122.445, 37.752],
zoom: 14
});
esriBundle.widgets.overviewMap.NLS_show = "Testing";
var overviewMapDijit = new OverviewMap({
map: map,
visible: true
});
overviewMapDijit.startup();
});
</script>
</head>
<body class="claro">
<div data-dojo-type="dijit/layout/BorderContainer"
data-dojo-props="design:'headline', gutters:false"
style="width: 100%; height: 100%; margin:0;">
<div id="map"
data-dojo-type="dijit/layout/ContentPane"
data-dojo-props="region:'center'"
style="padding:0">
</div>
</div>
</body>
</html>
... View more
04-08-2014
01:34 PM
|
2
|
0
|
3256
|
|
POST
|
I would suggest that you start a new thread and give a full description of what you're trying to do. There are sites like JSFiddle or JSBin where you can post your code that works or doesn't work and lets others see and adapt it.
... View more
04-08-2014
08:30 AM
|
0
|
0
|
3391
|
|
POST
|
FeatureLayer is inherited from GraphicsLayer. From the help information all graphics layers are always on top of TiledMapServiceLayers and DynamicMapServiceLayers.
... View more
04-07-2014
09:51 AM
|
0
|
0
|
1022
|
|
POST
|
Are you sure you're looking at the right variable? I'm seeing these options for the overviewmap widget [ATTACH=CONFIG]32878[/ATTACH]
... View more
04-07-2014
09:44 AM
|
2
|
0
|
4428
|
|
POST
|
IT's probably because you have that script loading before the Esri API script This is what works for me. It turns out my original script didn't work with multiple switches between the buttons, so that's been fixed.
<!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>Explicitly Create Map Service Layer List</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">
<script src="http://js.arcgis.com/3.8/"></script>
<script src="js/warbler4.js"></script>
</head>
<body class="claro">
<button id="btnAction1" data-dojo-type="dijit/form/Button">Action 1</button>
<button id="btnAction2" data-dojo-type="dijit/form/Button">Action 2</button>
<div id="map" class="claro" style="width:600px; height:400px; border:1px solid #000;"></div>
</body>
</html> js/warbler4.js code var layer, map, visible = [];
var action1, action2;
require(["esri/map", "dijit/registry", "dojo/parser", "dojo/on",
"dijit/form/Button", "dojo/domReady!"],
function (Map, registry, parser, on) {
parser.parse();
map = new Map("map", {
basemap: "topo",
center: [-122.45, 37.75], // long, lat
zoom: 13,
sliderStyle: "small"
});
registry.byId('btnAction1').on("click", function () {
if (action2 != undefined) {
action2.pause();
}
if (action1 == undefined) {
action1 = on.pausable(map, "click", function (evt) {
alert("Action 1!");
});
}
else {
action1.resume();
}
});
registry.byId('btnAction2').on("click", function () {
if (action1 != undefined) {
action1.pause();
}
if (action2 == undefined) {
action2 = on.pausable(map, "click", function (evt) {
alert("Action 2!");
});
}
else {
action2.resume();
}
});
});
... View more
04-07-2014
08:08 AM
|
0
|
0
|
2153
|
|
POST
|
Could you make an example in a Fiddle or JSBin to show this issue? I haven't experienced any problems
... View more
04-07-2014
07:00 AM
|
0
|
0
|
3190
|
|
POST
|
This code has possible map click actions, with a button to activate each one. <!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>Explicitly Create Map Service Layer List</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">
<script src="http://js.arcgis.com/3.8/"></script>
<script>
var layer, map, visible = [];
var action1, action2;
require(["esri/map", "dijit/registry", "dojo/parser",
"dijit/form/Button", "dojo/domReady!"],
function (Map, registry, parser) {
parser.parse();
map = new Map("map", {
basemap: "topo",
center: [-122.45, 37.75], // long, lat
zoom: 13,
sliderStyle: "small"
});
registry.byId('btnAction1').on("click", function () {
if (action2 != undefined) {
action2.remove();
}
if (action1 == undefined) {
action1 = map.on("click", function (evt) {
alert("Action 1 started");
});
}
});
registry.byId('btnAction2').on("click", function () {
if (action1 != undefined) {
action1.remove();
}
if (action2 == undefined) {
action2 = map.on("click", function (evt) {
alert("Action 2 started");
});
}
});
});
</script>
</head>
<body class="claro">
<button id="btnAction1" data-dojo-type="dijit/form/Button">Action 1</button>
<button id="btnAction2" data-dojo-type="dijit/form/Button">Action 2</button>
<div id="map" class="claro" style="width:600px; height:400px; border:1px solid #000;"></div>
</body>
</html>
... View more
04-07-2014
06:47 AM
|
0
|
0
|
2153
|
|
POST
|
Don't forget to click the check on the appropriate post to mark this thread as answered. This will help others in searching on this topic.
... View more
04-07-2014
06:26 AM
|
2
|
0
|
4428
|
| Title | Kudos | Posted |
|---|---|---|
| 3 | 2 weeks ago | |
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|