POST
|
Also, all graphics layers are always on top of TiledMapServiceLayers and DynamicMapServiceLayers." So you may need to change the way you're adding these layers, and either use two Feature layers, or two Dynamic layers. Yes, I try to do the same. I need my ArcGISDynamicMapServiceLayer to be on top of my FeatureLayer, since I need the labels of the ArcGISDynamicMapServiceLayer on top. To make the FeatureLayer transparent by setting the opacity is not the right way, then the colors of the FeatureLayer are not the same any more! I helped myself so far with another way of labeling, described here: var textSymbol = new esri.symbol.TextSymbol("Here be dragons");
textSymbol.setColor( new dojo.Color([128, 0, 0]));
textSymbol.setAlign(esri.symbol.TextSymbol.ALIGN_START);
textSymbol.setAngle(15);
textSymbol.setFont(font);
var pt= new esri.geometry.Point(x,y,map.spatialReference)
var gra = new esri.Graphic(pt,textSymbol);
map.graphics.add(gra); But this is not powerful enough for me, since there is no dynamical placement of labels anymore. Meaning the labels are fixed on one point on the map now! So you will find overlapping labels and label parts, cropped by the map border. Is there any way to display labels from an arcgis javascript api layer with all their advantages on top of a FeatureLayer? Please assist.
... View more
01-23-2012
03:19 AM
|
0
|
0
|
1037
|
POST
|
Hi Ann, obviously the MapPrinter.js doesn't find the layers of your map, when you try to generate the pdf. The map.layerIds property is a basic property of each esri map, described as: layerIds String[] Array of current TiledMapServiceLayers and DynamicMapServiceLayers added to the map. The reason may be that your map variable is empty at the moment of pdf generation (print(); function). Do you use the right variable? When you call print(); in the external js, is the variable empty since referneced in a wrong way? Add an alert at this point to see the value of the property, like: alert("External JS: map layers: "+map.layerIds); Best luck Cheers
... View more
02-18-2011
12:32 AM
|
0
|
0
|
523
|
POST
|
Hi Ann, the pdf generating function (print) must not be in your init() method, since there it would be called only once on load of the page. Cut line 64 to 66 and paste to line 77 behind your init(): var print = function() {
mapPrinter.generatePdf("title", "report", "");
}; Second thing: you don't call this function anywhere! Change your code in line 139 to: <a href="javascript:print();" class="print">Print</a> Best luck! Cheers Marcello
... View more
02-07-2011
12:35 AM
|
0
|
0
|
523
|
POST
|
Hi there, here the solution (partly taken from a former thread😞 Insert this code into the init() method of your page: // IE doesn't play nice attaching onkeyup/onkeydown to the window object...
var key_event_handle = dojo.isIE ? dojo.query('body')[0] : window;
dojo.connect(key_event_handle, "onkeydown", function(evt) {
if (evt.ctrlKey || evt.keyCode == 17) {
map.disablePan();
map.disableRubberBandZoom();
}
});
dojo.connect(key_event_handle, "onkeyup", function(evt) {
if (evt.ctrlKey || evt.keyCode == 17) {
map.enablePan();
map.enableRubberBandZoom();
}
}); Cheers Marcello
... View more
02-07-2011
12:10 AM
|
0
|
0
|
319
|
POST
|
Hi hzhu, thank you, I will give this a try tomorrow and come back to you... Cheers
... View more
02-02-2011
05:30 AM
|
0
|
0
|
319
|
POST
|
Hi there, we set up a map, using a rest service in an ArcGISDynamicMapServiceLayer. By pressing the Ctrl key while dragging the mouse and let go again, the map sticks to the mouse pointer and a continous panning is being performed It's not possible to cancel the panning. The only way to get out is to load the website again. I reproduced this in Esri example maps as well, as: http://help.arcgis.com/en/webapi/javascript/arcgis/demos/toolbar/toolbar_edit.html Any clues how to avoid/cancel this pan? Cheers Marcello
... View more
02-01-2011
10:59 PM
|
0
|
5
|
567
|
POST
|
Hi Ann, I don't have an idea, what it is, that throws you the syntax error. And I'm not familiar with IIS. Can you post your code? Cheers
... View more
02-01-2011
10:41 PM
|
0
|
0
|
523
|
POST
|
Hi Ann, It seems, as if your request parameter "layers" just contains a ".", instead of the layer urls. Perhaps try the whole thing this way: I don't use the PrintMap.js, but the MapPrinter.js instead. First I get the current http path of my own application and make a new instance of MapPrinter once in my init method, providing my esri.map and the path to the pdf directory of the application (line 1-4) Later to generate a pdf print, I call the generatePdf method of MapPrinter, providing a pdf name (headline of the later pdf document), a ReportGenerator to use and an empty "params" string (line 6)
path = self.location.href;
pos = path.lastIndexOf('/');
path = path.substring(0,pos);
mapPrinter = new MapPrinter(map, (path+"/pdf"));
mapPrinter.generatePdf("pdfname", "SampleReport", "");
This works fine for me. Hope this helps, Cheers Marcello
... View more
01-26-2011
02:41 AM
|
0
|
0
|
523
|
POST
|
I had massive problems with IE recently aswell. So here just a short hint: 1. use Internet Explorer 8, latest version 2. avoid to use this tag or similar on top: <meta http-equiv="X-UA-Compatible" content="IE=7" /> 3. use API version 2.1 4. if you declare dojo seperately with <script type="text/javascript" src="http://o.aolcdn.com/dojo/1.4.2/dojo/dojo.xd.js"></script>, use the appropriate version, that fits your API version see here best luck !
... View more
01-06-2011
04:53 AM
|
0
|
0
|
814
|
POST
|
Yes, it was a local configuration problem. When the administrators upgraded the IE6 to 8 recently, there was a mistake in the configuration of the group user settings. Now it's doing! Cheers Marcel and MERRY XMAS to ALL !
... View more
12-23-2010
04:18 AM
|
0
|
0
|
748
|
POST
|
Hi Jacob, ok, thank you for your reply! No, in my IE8 the 'OK' button is not doing. So it must be a local IE8 configuration problem. I'm just checking this. Cheers Marcel
... View more
12-22-2010
10:33 PM
|
0
|
0
|
748
|
POST
|
Hi Axel, true, versions of CSS and API were not same, so I changed versions accordingly. I couldn't find a claro.css 2.0, so I changed the API to 2.1 instead to have both in 2.1. I used the external dojo link just to try if this can be the problem. Now I disabled this code. Unfortunately this doesn't change anything in my IE8 browser. I still can't close the 'hello world' dialog by pressing 'OK'. I assume an IE settings problem of my local installation. Only, in the settings I'm not allowed to change too much as a default user. I added all the references to 'trusted sites' to avoid a JS disabling. I'm in contact with esri support meanwhile. So I hope we can sort it out this way. Cheers Marcel
... View more
12-22-2010
07:12 AM
|
0
|
0
|
748
|
POST
|
Here the important JavaScript declarations: <script type="text/javascript">djConfig = { parseOnLoad:true }</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.0"></script>
<script type="text/javascript" src="http://o.aolcdn.com/dojo/1.4.2/dojo/dojo.xd.js"></script> Here the logical JavaScript part: function opendialog(){
var cont = "hello world<br><p style='text-align:center'>"+
"<button type='button' value='close' onclick='dijit.byId(\"dialogHint\").hide();'>OK</button></p>";
dijit.byId('dialogHint').setContent(cont);
dijit.byId('dialogHint').show();
} Here the HTML part: <button type="button" value="open" onclick="opendialog();">open dialog</button> I built an example, using the following Esri code, see here. My example is accessable here. When you press the "open dialog" button, the opening dialog contains an "OK" button. This one closes the dialog. In Firefox it's doing fine, in IE8 it's not. Though, not only this dialog window is making me trouble, but all JavaScript code I try to perform in an dijit.Dialog. Can anyone help please?
... View more
12-20-2010
10:44 PM
|
0
|
0
|
748
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|