POST
|
I figured this out, so silly. We recently migrated our JSF application that the uses the map from one JSF framework to the other. When we did that, someone removed the class that was added to the <body> tag. I added that back in and now it's working. It's always the small things.
... View more
04-26-2013
05:46 AM
|
0
|
0
|
176
|
POST
|
I'm working on an application that requires that the infoWindow pop ups work outside of the map as well as inside. I have the pop up working, but for some reason there is no background, just text. I've created an infoWindow object like this: <div data-dojo-id="infowindow"
data-dojo-type="esri.dijit.InfoWindow" ></div> Once I get the data I need from my database, I do this: infowindow.setTitle("Milepost Summary");
infowindow.setContent(milepostEntityResults.innerHTML); I then do an infowindow.show to make it pop up. This all works, but when I get my pop up, it's just text, no background. If I change my code back to the way it was before I had the requirement of pop-ups outside of the map, everything looks fine. This is by creating the infoTemplate, adding it to the graphic and triggering it that way. However, I can't take this infoWindow outside of the map. Does anyone know what might cause this?
... View more
04-24-2013
01:28 PM
|
0
|
2
|
533
|
POST
|
Is it possible to put an infoWindow on text? We have a requirement to show an infoWindow when you not only click on the map, but on text that will show up alongside the map. Or possibly even triggering infoWindows by clicking on some text that is in a current infoWindow (ie. nested infoWindows). Looking at the api, it seems like you can only put it on a graphic. Thanks for any tips
... View more
03-23-2012
11:37 AM
|
0
|
0
|
678
|
POST
|
I have a map that will plot 2 points on the map, and connect them using a line. What I???m trying to accomplish is have one infoWindow when you click on the points, and a different one when you click on the lines connecting the points. I have no problem getting the content I want, but I need the windows to use 2 different sizes. I have a 2 methods that create the content for the appropriate infoWindows. In those methods, the first line is: map.infoWindow.resize(325, 75); or map.infoWindow.resize(250, 210); What happens is I view my map, click the line, and I get the smaller infoWindow. Then I click the point and get the larger infoWindow. From that point on, no matter what I click, I always get the large infoWindow. Here???s a couple examples of how I???m creating those infoWindows: function mapPoints(results){
var symbol = new esri.symbol.SimpleMarkerSymbol().setStyle(
esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE).setSize(8).setColor(
new dojo.Color( [ 255, 255, 255 ]));
graphicsExtent = [];
var infoTemplate = new esri.InfoTemplate;
infoTemplate.setTitle("Details");
infoTemplate.setContent(getInfoWindowContent);
var resultFeatures = results.features;
for (var i=0, length = resultFeatures.length; i < length; i++) {
// Add point to map to show location
var graphic = resultFeatures;
graphic.setSymbol(symbol).setInfoTemplate(infoTemplate);
....
function connectPoints(points){
for (var i = 0, len = points.length; i < len; i++)
{
var polyline = new esri.geometry.Polyline(map.spatialReference);
var thesePoints = [points, points[i+1]];
polyline.addPath(thesePoints);
//create graphic
var line = new esri.Graphic(polyline, new esri.symbol.SimpleLineSymbol());
line.setInfoTemplate(getLineInfoWindowContent(pointsArray, pointsArray[i+1]));
//add graphic to map
map.graphics.add(line);
....
... View more
03-23-2012
11:24 AM
|
0
|
0
|
504
|
POST
|
I've been working lately to get tabs working in my infoWindows. I have the tabs working, but now the placeholders that I'm putting in are no longer working. Before I started the tabs I had regular infoWindows and the same placeholders worked fine. Is there something to do with tabs that requires me to do this in a different way? Here's a snippet of my code that sets up the tabs.
function getInfoWindowContent() {
// Create a tab container
var tc = new dijit.layout.TabContainer({
style: "height: 100%; width: 100%;"
}, dojo.create("div"));
// Create first tab
var cp1 = new dijit.layout.ContentPane({
title: "Details",
content: "Name: ${NAME}"
});
tc.addChild(cp1); // Add tab to container
// Create second tab
var cp2 = new dijit.layout.ContentPane({
title: "Details 2",
content: "Content for Tab2"
});
tc.addChild(cp2); // Add tab to container
return tc.domNode;
}
function addPoints() {
...
var infoTemplate = new esri.InfoTemplate;
infoTemplate.setTitle("City Information");
infoTemplate.setContent(getInfoWindowContent);
symbol = new esri.symbol.SimpleMarkerSymbol().setStyle(
esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE).setSize(9).setColor(
new dojo.Color( [ 255, 255, 255]));
feature.setSymbol(symbol).setInfoTemplate(infoTemplate);
map.graphics.add(feature);
graphicsExtent.push(feature);
...
}
... View more
04-15-2011
09:25 AM
|
0
|
2
|
2001
|
POST
|
I corrected that and it's still not working for some reason. I changed the code a bit to try and simplify it. Here's what I'm working with now: var infoContent = "<div dojoType='dijit.layout.TabContainer' style='width: 100%; height: 100%;'>" +
"<div dojoType='dijit.layout.ContentPane' title='My first tab' selected='true'> This is my first tab </div>" +
"<div dojoType='dijit.layout.ContentPane' title='My second tab'> This is my second tab </div>" +
"</div>";
var tc = new dijit.layout.TabContainer({
style: "height: 100%; width: 100%;"
});
var cp1 = new dijit.layout.ContentPane({
title: "My first tab",
content: "This is my first tab"
});
tc.addChild(cp1);
var cp2 = new dijit.layout.ContentPane({
title: "My second tab",
content: "This is my second tab"
});
tc.addChild(cp2);
tc.startup();
var infoTemplate = new esri.InfoTemplate;
infoTemplate.setTitle("Info");
infoTemplate.setContent(tc.domNode); I've tried setting the last line to infoTemplate.setContent(infoContent); as well, and it still doesn't work. I have both ways set up because I tried doing the tabs programatically and also declaratively, neither way works. Setting the content to tc.domNode gives me the same error as before, setting the content to infoContent spits out the contents of both tabs but not in a tabbed interface. Also if you hover over them it gives you the titles of the tabs. I've ensured that I'm including the correct dojo.requires at the top, but can't see anything else I'm doing wrong. Any other ideas?
... View more
04-12-2011
10:28 AM
|
0
|
0
|
437
|
POST
|
I have a map set up that shows a route, and when you click on certain spots on the route, an infoWindow will pop up. The infoTemplate that the infoWindow is using is created when the map is routed, it's not getting the information dynamically via a feature layer. It's currenlty working fine with the default setup, but I'd like to include more information using tabs. I tried following the example set in this example: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/widget_infowindowchart.html That example doesn't work, but I'm thinking it might be something to do with the feature layer. Following this example, I'm getting an error saying: Message: Object doesn't support this property or method and it's pointing to the arcgis api rather than a line in my js. Here's a snapshot of what my infoWindow-related code looks like. Any ideas on what's causing my problems?
function addStops() {
....
for ( var i = 0; i < g_routeStops.length; i++) {
var feature = g_routeStops;
var infoTemplate = new esri.InfoTemplate;
infoTemplate.setTitle("Milepost Info");
infoTemplate.setContent(createInfoWindowContent);
symbol = new esri.symbol.SimpleMarkerSymbol().setStyle(
esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE).setSize(9).setColor(
new dojo.Color( [ 255, 255, 255]));
feature.setSymbol(symbol).setInfoTemplate(infoTemplate);
map.graphics.add(feature);
.....
}
function createInfoWindowContent(graphic){
var tc = new dijit.layout.tabContainer({
style: "height: 100%; width: 100%"
}, dojo.create("div"));
var cp1 = new dijit.layout.ContentPane({
title: "Info",
content: "info tab"
});
tc.addChild(cp1);
var cp2 = new dijit.layout.ContentPane({
title: "Details",
content: "details tab"
});
tc.addChild(cp2);
return dc.domNode;
}
... View more
04-01-2011
11:55 AM
|
0
|
5
|
4172
|
POST
|
I'm using a TextSymbol to label points I'm placing on my map. Problem is, sometimes it can be hard to read because of all the things going on with the map. Is it possible to put the TextSymbol inside a box, give it a background color, or highlight the text in some way to help it stand out from the background? There's no built-in way to change anything but the alignment and the underline/overline, but I was hoping someone might know a trick for this. http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/textsymbol.htm
... View more
03-22-2011
12:36 PM
|
0
|
1
|
1252
|
POST
|
So simple, but that works like a champ. Thanks for your help!
... View more
03-11-2011
03:22 AM
|
0
|
0
|
592
|
POST
|
I'm doing this same thing, using the same method. It works for me some of the time. I have a map that puts a route on there, similar to driving directions you'd get from Google maps and whatnot. Sometimes, it zooms in perfectly. Sometimes it zooms in too far, so it cuts the part of the route off. Any idea what would cause this?
... View more
03-10-2011
10:10 AM
|
0
|
0
|
592
|
POST
|
I checked on the forums and didn�??t see an answer to what I�??m trying to do, so hoping someone will know. I have an ArgGIS map using the JavaScript API. It creates a route on the map using several dots connected by lines. We would like the ability to create a right-click context menu. We�??re creating the project using RichFaces, and of course we also have access to the dojo framework. Both of these frameworks provide a menu like the one I�??m looking for. Dijit.Menu: http://dojotoolkit.org/reference-guide/dijit/Menu.html (Programmatic example and Declaritive markup example) Richfaces context menu: http://liferay.exadel.com/web/guest (Click �??Rich menu�?? on the left, then �??Context Menu�??) The problem is that both of these solutions require the item you right-click to have an ID attribute, which the map graphics don�??t. Is there a way that anyone knows to integrate one of these context menus into my map? Thanks!
... View more
03-10-2011
04:41 AM
|
0
|
0
|
1569
|
POST
|
Any idea how to set up the highlight font? I've seen that effect on an esri map that was written using the web ADF version, but not the Javascript version. I've checked out the API for font and for a textSymbol and neither one mentions a highlight property.
... View more
01-19-2011
12:00 PM
|
0
|
0
|
1437
|
POST
|
I have a map set up puts dots on the map, and draws lines connecting the dots to create a route. Each dot has a textSymbol next to it that I'm using to label each dot for the user. The problem is that with all the stuff in the background, it can be hard to read those labels sometimes. I'm wondering if there's any way to put a background behind the textSymbol to help it stand out. I know about infoWindows, but I'm already using those when you click on the dot to give you more information. Here's a snippet from my code that runs when it's looping through the route and putting the dots on the map. This is the portion that adds the labels. ...
font = new esri.symbol.Font("10pt", esri.symbol.Font.STYLE_NORMAL,
esri.symbol.Font.VARIANT_NORMAL,esri.symbol.Font.WEIGHT_NORMAL,"Verdana");
...
var textSymbol = new esri.symbol.TextSymbol(feature.attributes["LABEL"]).setColor(new dojo.Color([255, 0, 0])).
setOffset(30, 0).setFont(font).setKerning(true);
var point = new esri.geometry.Point(feature.attributes["NNLL_LONG_DEC"], feature.attributes["NNLL_LAT_DEC"], map.spatialReference);
map.graphics.add(new esri.Graphic(point, textSymbol));
... Any ideas?
... View more
01-19-2011
05:50 AM
|
0
|
29
|
15892
|
POST
|
You can check to see if the ctrl key is held down using js. Here's an example: http://www.java2s.com/Tutorial/JavaScript/0300__Event/Iscontrolkeypressedduringthemouseclick.htm It looks like dojo also has built-in ways of checking the ctrl key. I've never used them, but perhaps these examples might help you out: http://o.dojotoolkit.org/forum/dojo-core-dojo-0-9/dojo-core-support/dojo-keys-combination or line 124 here: http://bugs.dojotoolkit.org/browser/dijit/trunk/tests/tree/robot/Tree_selector.html?rev=23016 Hope that helps you out some. J
... View more
12-03-2010
06:44 AM
|
0
|
0
|
264
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|