|
POST
|
i think this is what your looking for hxxp://gis.stackexchange.com/questions/12407/how-to-identify-layers-from-multiple-arcgis-server-instances
... View more
05-08-2012
12:57 PM
|
0
|
0
|
1462
|
|
POST
|
works perfect...after setting var lbls globally.
dojo.connect(map, "onZoomEnd", checkScale);
function checkScale(extent, zoomFactor, anchor, level){
if (level > 7 && level < 16){
lbls.show()
}
else {
lbls.hide()
}
//we can retreive the scale here, but level works just as well
//var scale = esri.geometry.getScale(map)
}
... View more
05-07-2012
08:35 AM
|
0
|
0
|
1201
|
|
POST
|
building html strings can be tricky; use of double vs single quote this should work content+="<td><a href='http://surveyor.slco.org/javamap/mrs_test.cfm?"+layerResults.features.attributes['POINT_NAME']+layerResults.features.attributes['LATITUDE_DD'] + " target='_blank'>Mon. Ref Sheet</a></td>"; In js, you can't have a string containing double quote "; the string has to contain single quote ' like this var str = "<a href='myurl'>text</a>"; // <-- single quotes around href attribute, inside of " "
... View more
05-04-2012
04:19 PM
|
0
|
0
|
1024
|
|
POST
|
In your locomotive query, you need to change the last line from: MPQueryTask.execute(LocQuery, LocSymbology); to: LocQueryTask.execute(LocQuery, LocSymbology); think you forgot to change it to the locomotive query task after you c/p it
... View more
05-04-2012
04:09 PM
|
0
|
0
|
511
|
|
POST
|
it's hard to say for sure what the problem is, but it looks like something's wrong with your config.js fields & aliases objects. Browse to the rest endpoint of this feature layer: MontroseCOfeatures/MapServer/10 and have a look at what the actual field names & aliases, then directly copy/paste these into the fields & aliases objects in config.js I know that a dojox.grid.datagrid store requires that keyField, also defined in config.js be a field with unique values I am adapting the Tax Parcel Viewer from the link below to my map services. The basics are working fine, but the problem appears to be with the InfoWindow. Tax Parcel Viewer The problem is that when I click on a record in the Search (FindTask) results table, the target feature is highlighted on the map (which is good) but the app does not zoom to the feature or show the InfoWindow for that feature as it is supposed to. All this works perfectly fine though if I just click directly on a feature on the map. The problem only occurs when selecting a record in the Search results table. Furthermore, it will work fine from the Search results table if I 'hard code' in the InfoWindow Title text, as opposed to what I want which is to pass in a variable attribute value from the Graphics object. When using Firebug to debug, the app code halts at line 183 - the map.infoWindow.setTitle statement. So something about the infoWindow or infoTemplate, plus the passing of a variable, is not working properly with the results table click event. Any insight would be welcomed. Thanks much. Lee Code attached as Zip files - one Zip has the Index.html and the other Zip has the Common.js and Config.js.
... View more
05-04-2012
03:58 PM
|
0
|
0
|
824
|
|
POST
|
I filled a new graphics layer with text symbols; one for each point in a feature layer. The below function works fine and the labels are displayed correctly in their +50,+50 offset location, but how do I control the graphics layer visibility based on scale? thanks! function createLabels(){ var queryTask = new esri.tasks.QueryTask("REST url"); var query = new esri.tasks.Query(); query.returnGeometry = true; query.outFields = ["site_code"]; query.where = "site_code LIKE '%'"; queryTask.execute(query, function(featureSet){ map.graphics.clear(); var lbls = new esri.layers.GraphicsLayer(); var font = new esri.symbol.Font("9px", esri.symbol.Font.STYLE_NORMAL, esri.symbol.Font.VARIANT_SMALLCAPS, esri.symbol.Font.WEIGHT_BOLDER); for (var i=0, il=featureSet.features.length; i<il; i++) { var x = featureSet.features.geometry.x + 50; var y = featureSet.features.geometry.y + 50; featureSet.features.geometry.x = x; featureSet.features.geometry.y = y; var graphic = featureSet.features.attributes.site_code; var textSymbol = new esri.symbol.TextSymbol(graphic, font, new dojo.Color([0, 0, 0])); var symb = featureSet.features; symb.setSymbol(textSymbol); lbls.add(symb); }; map.addLayer(lbls); }); }
... View more
05-03-2012
02:38 PM
|
0
|
2
|
3098
|
|
POST
|
adding the onUpdateEnd listener to the last featLayer that's added to the map seemed to do the trick. I also changed to "ONDEMAND" mode.
dojo.connect(map, "onLayerAdd", function(layer) {
//console.log(layer.id);
if(layer.id == "featLayer1"){
ShowLoadingMessage('Loading...'); // <-- fires loading indicator
}
});
var handle = dojo.connect(featLayer3, "onUpdateEnd", function(){
createLabels();
HideLoadingMessage(); <--hides load indicator
dojo.disconnect(handle)
});
... View more
05-03-2012
02:33 PM
|
0
|
0
|
1848
|
|
POST
|
onLayerAdd fires when a layer is added to the map. A layer being added to the map is not the same as all features being visible on the map. Ideally, your features would load fast enough that you don't need to show a loading icon. If that's not the case, look at using your layers' onUpdateEnd event. You could set up a listener for this event and then disconnect the listener after the event fires the first time. To do this for multiple layers, you could check each layer's updating property. When all updating is false for all your feature layers, you would hide your loading icon and disconnect your event listener using dojo.disconnect. thanks for the reply. I noticed that when the featlayer is added to the map a RestURL/layerID/query? call is made to the server. It looks like the features aren't actually displayed until the query is returned from the server, which in my case takes awhile because some of the featlayers have >1K records. I'll try this out and report back...
... View more
05-03-2012
09:39 AM
|
0
|
0
|
1848
|
|
POST
|
Here's what I have. It fires the loading indicator fine, but hides the indicator too soon. It's still several seconds after the indicator is hidden that featLayer3 actually appears on the map... what could be causing this?
dojo.connect(map, "onLayerAdd", function(layer) {
//console.log(layer.id);
if(layer.id == "featLayer1"){
ShowLoadingMessage('Loading...'); // <-- fires loading indicator
}
else if (layer.id == "featLayer3"){
HideLoadingMessage(); // <--hides loading indicator
}
});
var legendLayers = [];
var featLayer1 = new esri.layers.FeatureLayer(url11, {id:'featLayer1'});
legendLayers.push({layer:featLayer1,title:"featLayer1"});
var featLayer2 = new esri.layers.FeatureLayer(url22, {id:'featLayer2'});
legendLayers.push({layer:featLayer2,title:"featLayer2"});
var featLayer3 = new esri.layers.FeatureLayer(url33, {id:'featLayer3'});
legendLayers.push({layer:featLayer3,title:"featLayer3"});
var featLayers = [];
dojo.forEach(legendLayers,function(layer){
featLayers.push(layer.layer)
});
map.addLayers(featLayers);
... View more
05-03-2012
08:46 AM
|
0
|
0
|
1848
|
|
POST
|
ShowLoadingMessage fires and displays loading animation dojo.connect(map,"onUpdateStart", ShowLoadingMessage('Loading...')) HideLoadingMessage fires when the basemap is successfully drawn dojo.connect(map, "onUpdateEnd", HideLoadingMessage); identifyManager login then pops up, asking for username/password. After signing in, the 9 feature layers are then added to map, but it takes a few seconds; how do I fire my ShowLoadingMessage, then fire HideLoadingMessage when all feature layers are drawn? I looked through featurelayer events and can't find what I'm looking for. thanks!
... View more
05-02-2012
08:59 AM
|
0
|
8
|
3369
|
|
POST
|
Thanks Kelly!! I've been searching for this answer for awhile!
... View more
05-02-2012
08:51 AM
|
0
|
0
|
1802
|
|
POST
|
Hi all, I'm trying to use a TabContainer in my own InfoWindow and it doesn't work. I'll show my code. I'm using dojo toolkit 1.6
--------------------- My InfoWindow.js----------------------
dojo.provide("gvdi.InfoWindow");
dojo.require("esri.InfoWindowBase");
dojo.require("dojo.fx");
/***************
* MyInfoWindow
***************/
dojo.declare("gvdi.InfoWindow", [ esri.InfoWindowBase ], {
constructor: function(parameters) {
dojo.mixin(this, parameters);
isContentShowing: false;
isContentShowing: true;
isMouseOver: false;
isMouseClick: false;
dojo.addClass(this.domNode, "myInfoWindow");
this._closeButton = dojo.create("div", { "class": "close", title: "Cerrar" }, this.domNode);
this._title = dojo.create("div", { "class": "title" }, this.domNode);
this._content = dojo.create("div", { "class": "content" }, this.domNode);
this._toggleButton = dojo.create("div",{"class": "toggleOpen", title:"Expandir"},this.domNode);
var toggler = new dojo.fx.Toggler({
node: this._content,
showFunc: dojo.fx.wipeIn,
hideFunc: dojo.fx.wipeOut
});
toggler.hide();
this._eventConnections = [
dojo.connect(this._closeButton, "onclick", this, function(){
this.hide();
//hide the content when the window is closed so it displays in closed state next time it opens.
if(this.isContentShowing){
toggler.hide();
this.isMouseOver = false;
this.isMouseClick = false;
this.isContentShowing = false;
dojo.removeClass(this._toggleButton);
dojo.addClass(this._toggleButton,"toggleOpen");
}
}),
dojo.connect(this._toggleButton,"onclick",this,function(){
//animate the display of content
if(this.isContentShowing){
toggler.hide();
this.isContentShowing = false;
dojo.removeClass(this._toggleButton);
dojo.addClass(this._toggleButton,"toggleOpen");
}else{
toggler.show();
this.isContentShowing=true;
dojo.removeClass(this._toggleButton);
dojo.addClass(this._toggleButton,"toggleClose");
}
})
];
// Hidden initially
esri.hide(this.domNode);
this.isShowing = false;
},
/*****************************************
* Override and implement methods defined
* by the base class: InfoWindowBase
*****************************************/
setMap: function(map) {
// Run logic defined in the base class
this.inherited(arguments);
// hide the info window when the user is focusing elsewhere.
this._eventConnections.push(dojo.connect(map, "onPanStart", this, this.hide));
this._eventConnections.push(dojo.connect(map, "onZoomStart", this, this.hide));
},
setTitle: function(title) {
this.place(title, this._title);
},
setContent: function(content) {
this.place(content, this._content);
},
show: function(location) {
// Is location specified in map coordinates?
if (location.spatialReference) {
location = this.map.toScreen(location);
}
// Position 10x10 pixels away from the
// requested location
dojo.style(this.domNode, {
left: (location.x + 16) + "px",
top: (location.y + 16) + "px"
});
// Display
esri.show(this.domNode);
this.isShowing = true;
this.onShow();
},
hide: function() {
esri.hide(this.domNode);
this.isMouseClick = false;
this.isShowing = false;
this.onHide();
},
resize: function(width, height) {
dojo.style(this._content, {
width: width + "px",
height: height + "px"
});
dojo.style(this._title,{
width: width + "px"
});
},
/************************************
* Defining some methods specific to
* my info window
************************************/
destroy: function() {
dojo.forEach(this._eventConnections, dojo.disconnect);
dojo.destroy(this.domNode);
this.isMouseClick = false;
this._closeButton = this._title = this._content = this._eventConnections = null;
},
mostrarExtendido: function(){
esri.show(this._content);
this.isContentShowing=true;
dojo.removeClass(this._toggleButton);
dojo.addClass(this._toggleButton,"toggleClose");
},
setMouseOver: function(mouseOver) {
this.isMouseOver = mouseOver;
},
getMouseOver: function() {
return this.isMouseOver;
},
setMouseClick: function(mouseClick) {
this.isMouseClick = mouseClick;
},
getMouseClick: function() {
return this.isMouseClick;
},
mostrarReducido: function(){
esri.hide(this._content);
this.isContentShowing=false;
dojo.removeClass(this._toggleButton);
dojo.addClass(this._toggleButton,"toggleOpen");
}
});
--------------------------- End InfoWindow.js--------------------------
function insertIncident(id,tactica,xPos,yPos,estado,areaOp){
var geo = new esri.geometry.Point(xPos,yPos,new esri.SpatialReference({ wkid: 25830 }));
var ip = new esri.Graphic(geo, null);
var attr = {"xPos":xPos,"yPos":yPos,"id":id,"tactica":tactica,"estado":estado,"areaOp":areaOp};
ip.setAttributes(attr);
var infoTemplate = new esri.InfoTemplate("${id}  ","" +
"<strong>ID:</strong> ${id}<br/>" +
"<strong>Tactica:</strong> ${tactica}<br/>" +
"<strong>Area op:</strong> ${areaOp}<br/>");
ip.setInfoTemplate(infoTemplate);
//TODO: cambiar la gestion del icono a constantes java
var icon = "";
if (estado == "ACT")
icon = "./images/icons/incidverde.png";
else if (estado == "TACT")
icon = "./images/icons/incidgris.png";
else if (estado == "APER")
icon = "./images/icons/incidrojo.png";
//Comprobamos si existe un punto con las mismas coordenadas para crear un InfoWindow normal o multiple
if(xyPointExists(xPos,yPos)){
icon = "./images/icons/bancosbn.png";
var template = new esri.InfoTemplate();
template.setTitle("<b> TITULO!!!  </b>");
template.setContent(getWindowContent());
ip.setInfoTemplate(template);
myMultipleInfoWindowXY(ip,icon);
}else{
....
}
...
}
function getWindowContent(){
var tc = new dijit.layout.TabContainer({
style: "height: 100%; width: 150px;"
}, dojo.create("div"));
var cp1 = new dijit.layout.ContentPane({
title: "Details",
content: "sdafsadf<br>2355345<br>"
});
var cp2 = new dijit.layout.ContentPane({
title: "Details",
content: "34523453<br>2355345<br>"
});
tc.addChild(cp1);
tc.addChild(cp2);
return tc.domNode;
}
function myMultipleInfoWindowXY(elemento,icono){
try{
var imageSymbol = new Image();
var point;
imageSymbol.src = icono;
gvdiDefaultMap.graphics.add(elemento.setSymbol(esri.symbol.PictureMarkerSymbol(icono,imageSymbol.width,imageSymbol.height)));
dojo.connect(gvdiDefaultMap.graphics, "onClick", function(evt) {
var g = evt.graphic;
gvdiDefaultMap.infoWindow.setMouseOver(false);
gvdiDefaultMap.infoWindow.setMouseClick(true);
//gvdiDefaultMap.infoWindow.setContent(g.getContent()); //Also tried this
gvdiDefaultMap.infoWindow.setContent(getWindowContent());
gvdiDefaultMap.infoWindow.setTitle(g.getTitle());
gvdiDefaultMap.infoWindow.show(evt.screenPoint,gvdiDefaultMap.getInfoWindowAnchor(evt.screenPoint));
});
dojo.connect(gvdiDefaultMap.graphics, "onMouseMove", function(evt) {
if(!gvdiDefaultMap.infoWindow.getMouseClick()){
var g = evt.graphic;
gvdiDefaultMap.infoWindow.setMouseOver(true);
gvdiDefaultMap.infoWindow.setContent(g.getContent());
gvdiDefaultMap.infoWindow.setTitle(g.getTitle());
gvdiDefaultMap.infoWindow.show(evt.screenPoint,gvdiDefaultMap.getInfoWindowAnchor(evt.screenPoint));
}
});
dojo.connect(gvdiDefaultMap.graphics, "onMouseOut", function() {
if(gvdiDefaultMap.infoWindow.getMouseOver() && !gvdiDefaultMap.infoWindow.getMouseClick())
gvdiDefaultMap.infoWindow.hide();
} );
}catch(error){
mostrarError("gvdiApEstDivMedShowInfoWindowXY "+error);
}
}
And this is the result: [ATTACH=CONFIG]13925[/ATTACH] Need help please!!! Thank a lot. Let me guess...you replaced the default infoWindow with an esri.dijit.popup, then tried adding tab to the dijit.popup? I've been trying this for a month now to no avail. By replacing infoWindow, I mean like this:
var popup = new esri.dijit.Popup({
fillSymbol: new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]))
}, dojo.create("div"));
map = new esri.Map("map", {extent: startExtent,infoWindow:popup});
... View more
04-30-2012
06:08 AM
|
0
|
0
|
1802
|
|
POST
|
"IE has blocked this website from displaying content with security certificate errors" this ribbon error in internet explorer goes away when this is removed from the map: <script type="text/javascript" src="https://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.8"></script> If adding the JS api using http, then IE displays this error: "do you want to view only the webpage content that was delivered securely" Looks like my only option is to install JS api locally
... View more
04-24-2012
02:01 PM
|
0
|
0
|
940
|
|
POST
|
we purchased a wildcard ssl cert and installed it on the server; in the ssl cert, the CN=*mydomain.com I'm guessing IE throws the warning because *mydomain.com <> gis.mydomain.com ??
... View more
04-24-2012
11:55 AM
|
0
|
0
|
940
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-02-2024 04:44 PM | |
| 1 | 11-04-2025 11:45 AM | |
| 1 | 10-31-2025 06:53 AM | |
| 1 | 02-06-2019 06:41 AM | |
| 1 | 02-18-2025 11:55 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-07-2026
07:13 AM
|