|
POST
|
Brandon, In the widget.js for the edit widget is where I entered this code: (line 223) query('.sizer', this.map.infoWindow.domNode).style({ width: '400px' }); Yes i was able to resolve the issue by changing to .sizer This only works in the edit popup though. I am not 100% sure how to apply to all. The code Above changed all the popups but the one below did not : query('.contentPane', this.map.infoWindow.domNode).style({ width: '400px' });
... View more
05-06-2015
09:15 AM
|
1
|
3
|
2681
|
|
POST
|
Brandon, On another note: Could this same concept be applied to pop-up containers? There are some questions out on geonet, some of them mine, on editing the default pop-up window size. Have you seen this Popup Size for Edit widget
... View more
05-06-2015
08:46 AM
|
1
|
1
|
917
|
|
POST
|
Aravind Sivasailam, I added "esri/layers/FeatureLayer" to your script, found:FeatureLayer | API Reference Try this: <!DOCTYPE html>
<html>
<head>
<title>Create a Web Map</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css">
<style>
html,body,#mapDiv,.map.container{
padding:0;
margin:0;
height:100%;
}
#layerList{
background-color: #fff;
position: absolute !important;
z-index: 99;
padding:10px;
top:10px;
right:20px;
}
</style>
<script>var dojoConfig = { parseOnLoad:true };</script>
<script src="http://js.arcgis.com/3.13/"></script>
<script>
var map;
require([
"esri/map",
"esri/arcgis/utils",
"dojo/_base/array",
"dojo/dom-construct",
"dojo/on", "esri/layers/FeatureLayer" ,
"dojo/domReady!"
], function (
Map,
arcgisUtils,
array,
domConstruct,
on, FeatureLayer
) {
arcgisUtils.createMap("d73cf988e0e04e19af01c91b9c7d62fe", "mapDiv").then(function (response) {
map = response.map; //Get the layers in the map.
var operationalLayers = response.itemInfo.itemData.operationalLayers;
array.forEach(operationalLayers , function(layer){
//create a checkbox and label for each layer in the map
var cbox = domConstruct.create("input",{
type: "checkbox",
name: layer.title,
value: layer.id,
checked: layer.visibility
},"layerList");
var cbox_label = domConstruct.create("label",{
htmlFor: layer.title,
innerHTML: layer.title + "</br>"
},"layerList");
//When the checkbox is clicked change the layer visibility
on(cbox, "click", function(evt){
//Find the layer based on the layer id
var layerid = evt.target.value;
var layer = map.getLayer(layerid);
layer.setVisibility(evt.srcElement.checked);
});
})
});
});
</script>
</head>
<body>
<div id="mapDiv"></div>
<div id="layerList"></div>
</body>
</html> EDIT: Never mind You see to have found the solution.
... View more
05-06-2015
07:12 AM
|
2
|
0
|
1561
|
|
POST
|
Thomas, Here is a link that will help you with info windows/popups Samples | popups_and_info_windows, and InfoWindow | API Reference Tim Witt's example is very nice too!
... View more
05-06-2015
07:04 AM
|
2
|
1
|
1979
|
|
POST
|
If you are writing your own widget I would look at the sample widgets found at: arcgis-web-appbuilder-1.1\client\stemapp\widgets\samplewidgets I would suggest adding a button on the bookmark widget to zoom to next bookmark.
... View more
05-05-2015
08:53 AM
|
1
|
0
|
2938
|
|
POST
|
Arjun Dongre have you seen this: arcgis javascript api - Customize the legend elements - Geographic Information Systems Stack Exchange
... View more
05-05-2015
08:45 AM
|
0
|
1
|
3145
|
|
POST
|
Arjun, Try either of these CSS: This one disables the bold "cemetery" below .esriLegendServiceLabel {
font-weight: bold;
visibility: hidden;
} OR This one disables the "Cemetery Plots" below
.esriLegendLayerLabel {
padding-top: 5px;
visibility: hidden;
} If you are trying to disable one title and not another that will be more work.
... View more
05-05-2015
08:27 AM
|
1
|
3
|
3145
|
|
POST
|
Arjun, Are you talking about the Legend Widget for Web AppBuilder ? If you are not can you post an example of what legend widget you are talking about?
... View more
05-05-2015
08:13 AM
|
0
|
5
|
3145
|
|
POST
|
Chad, I have the widget working for one definition query. I am currently working on multiple query widget. I am thinking like a filter widget. Yes if you look above at "var statesUrl" you will see that when the widget loads the layer is added to the map. Right now my solution is to have the widget open on load but I am trying to find a way to add when map loads. If you want radio or checkbox buttons change the html to radio or checkbox (<input type="checkbox" id="EastCoast"/>East Coast ) and the .js line 108 to match the input type. In my case I want a drop down list so i have select. //setup click event for buttons query("select").forEach(function (node) { The html used is: <div>
Choose Floor Number:
</center>
<select id="s5" data-dojo-id="s5" data-dojo-attach-point="test" data-dojo-type="dijit/form/Select" data-dojo-props='test'>
<option value="0">0</option>
<option value="1" selected="selected">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="" disabled="true">----------</option>
<option value="Clear">All</option>
<option value="11">None</option>
</select>
</div>
</div>
... View more
05-05-2015
07:24 AM
|
1
|
0
|
2853
|
|
POST
|
Chad, Here is the .js part of my floor switcher. The way I handled the floor change is setdefinitionexpression. var map, dialog;
define([
'dojo/_base/declare',
'jimu/BaseWidget',
'jimu/ConfigManager',
'jimu/MapManager',
'esri/urlUtils',
'dojo/_base/array',
'dojo/_base/query',
"dojo/_base/connect",
'esri/layers/ArcGISDynamicMapServiceLayer',
'esri/layers/ArcGISTiledMapServiceLayer',
'esri/layers/FeatureLayer',
'esri/layers/ImageParameters',
'esri/dijit/BasemapGallery',
'esri/dijit/BasemapLayer',
'esri/dijit/Basemap',
'esri/basemaps',
'esri/dijit/PopupTemplate',
"esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol",
"esri/renderers/SimpleRenderer", 'dojo/_base/html', 'dojo/on', "esri/symbols/TextSymbol",
"esri/layers/LabelLayer", "esri/Color",
'dojo/domReady!'
],
function (
declare,
BaseWidget,
ConfigManager,
MapManager,
urlUtils,
array,
query,
connect,
ArcGISDynamicMapServiceLayer,
ArcGISTiledMapServiceLayer,
FeatureLayer,
ImageParameters,
BasemapGallery,
BasemapLayer,
Basemap,
esriBasemaps,
PopupTemplate, SimpleFillSymbol, SimpleLineSymbol,
SimpleRenderer, html, on, TextSymbol,
LabelLayer, Color) {
//To create a widget, you need to derive from BaseWidget.
return declare([BaseWidget], {
// Custom widget code goes here
baseClass: 'definition_query',
//this property is set by the framework when widget is loaded.
//name: 'CustomWidget',
//methods to communication with app container:
postCreate: function () {
this.inherited(arguments);
console.log('postCreate');
},
startup: function () {
this.inherited(arguments);
var states2 = new FeatureLayer("http://yourURL/arcgis/rest/services/sandbox/rickey_floorplanlines/MapServer/1", {
mode: FeatureLayer.MODE_AUTO,visibility: false,
outFields: ["*"]
});
states2.setDefinitionExpression("FLOOR = '1'");
this.map.addLayer(states2);
var labelField = "Label";
// create a renderer for the states layer to override default symbology
var statesColor = new Color("#c92e49");
// create a feature layer to show country boundaries
var statesUrl = "http://yourURL/arcgis/rest/services/sandbox/rickey_PrePlan/MapServer/0";
var states = new FeatureLayer(statesUrl, {
id: "states",
opacity: 0.0,
outFields: ["Label"]
});
states.setDefinitionExpression("FLOOR = '1'");
this.map.addLayer(states);
// create a text symbol to define the style of labels
var statesLabel = new TextSymbol().setColor(statesColor);
statesLabel.font.setSize("11pt");
statesLabel.font.setFamily("arial");
var statesLabelRenderer = new SimpleRenderer(statesLabel);
var labels = new LabelLayer({
id: "labels"
});
// tell the label layer to label the countries feature layer
// using the field named "admin"
labels.addFeatureLayer(states, statesLabelRenderer, "{" + labelField + "}");
// add the label layer to the map
this.map.addLayer(labels);
//setup click event for buttons
query("select").forEach(function (node) {
on(node, "click", function (e) {
var target = e.target || e.srcElement;
switch (target.value) {
case "0":
defExp = "FLOOR='0'";
break;
case "1":
defExp = "FLOOR='1'";
break;
case "2":
defExp = "FLOOR='2'";
break;
case "3":
defExp = "FLOOR='3'";
break;
case "4":
defExp = "FLOOR='4'";
break;
case "5":
defExp = "FLOOR='5'";
break;
case "6":
defExp = "FLOOR='6'";
break;
case "7":
defExp = "FLOOR='7'";
break;
case "8":
defExp = "FLOOR='8'";
break;
case "9":
defExp = "FLOOR='9'";
break;
case "10":
defExp = "FLOOR='10'";
break;
case "11":
defExp = "FLOOR='11'";
break;
case "Clear":
defExp = "";
break;
}
states.setDefinitionExpression(defExp);
states2.setDefinitionExpression(defExp);
});
});
},
onOpen: function () {
console.log('onOpen');
},
onClose: function () {
console.log('onClose');
},
onMinimize: function () {
console.log('onMinimize');
},
onMaximize: function () {
this.console.log('onMaximize');
},
onSignIn: function (credential) {
/* jshint unused:false*/
console.log('onSignIn');
},
onSignOut: function () {
console.log('onSignOut');
},
onPositionChange: function () {
console.log('onPositionChange');
},
resize: function () {
console.log('resize');
}
//methods to communication between widgets:
});
});
... View more
05-04-2015
02:01 PM
|
3
|
2
|
2853
|
|
POST
|
Larry, The code you provided almost worked. Now the popup content extends past the rest of the popup. EDIT. I found it: query('.sizer', this.map.infoWindow.domNode).style({ width: '400px' }); This changes the edit popup but not the other ones.
... View more
04-30-2015
07:14 AM
|
1
|
5
|
2681
|
|
POST
|
I have the same problem when attempting to type in a text box and my cursor is over the map. My solution is to move the cursor away from the map. I would assume there is code that says when text box is selected ignore all other functions.
... View more
04-30-2015
06:37 AM
|
0
|
0
|
1428
|
|
POST
|
Stan, This works for all my popups except the edit widget. Thank you
... View more
04-29-2015
01:15 PM
|
0
|
7
|
2681
|
|
POST
|
I cannot seem to find where to change the size of the popup widget. Can someone direct me to the right location. It is just a tad to small.
... View more
04-29-2015
12:17 PM
|
0
|
9
|
10554
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-28-2025 01:53 PM | |
| 1 | 08-24-2022 09:40 AM | |
| 1 | 07-19-2018 04:41 PM | |
| 1 | 04-05-2024 03:12 PM | |
| 1 | 07-04-2024 11:42 AM |