POST
|
Not quite what I was looking for but I found a solution; Basically, I set the content of the infowindow and measured the outer-most tag (in my case a table), then used these measurements with some padding to account for the rest of the dialog, to set the size of the infowindow. It also helped converting spaces in text to " "'s. I�??ve been looking for it too! I just want to dynamically set the size of the infowindow based on its content data size, but i do not quite understand your solution, could you give some sample code ?
... View more
07-12-2010
05:29 PM
|
0
|
0
|
258
|
POST
|
i don't think you need to explicitly set the map height and width. i believe the map.resize() should do that for you. init: function(panel) {
Ext.apply(panel, {
onRender: panel.onRender.createSequence(function(ct, pos) {
var id = panel.body.dom.id ? panel.body.dom.id : panel.id;
dojo.addOnLoad(this.initEsriMap.createDelegate(this, [id]));
} .createDelegate(this))
, onResize: panel.onResize.createSequence(function(w, h) {
var width = panel.getInnerWidth();
var height = panel.getInnerHeight();
if (this.map) {
//this.map.width = width;
//this.map.height = height;
this.map.resize();
this.map.reposition();
}
} .createDelegate(this))
})
} if the problem is still there try using the timer approach: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/map.htm#resize Yes, you are right, now everything is okay! Thank you so much, ajpfister06:cool:.
... View more
06-29-2010
06:33 PM
|
0
|
0
|
306
|
POST
|
so you are calling the .reposition() and .resize() methods? can you post a complete code sample? using the CODE tags? I'm using Ext JavaScript, and i extend a plugin for panel, which can render the map object to the panel. Here is the init function of the plugin, i just call them after the default 'onResize' event handler. init: function(panel) {
Ext.apply(panel, {
onRender: panel.onRender.createSequence(function(ct, pos) {
var id = panel.body.dom.id ? panel.body.dom.id : panel.id;
dojo.addOnLoad(this.initEsriMap.createDelegate(this, [id]));
} .createDelegate(this))
, onResize: panel.onResize.createSequence(function(w, h) {
var width = panel.getInnerWidth();
var height = panel.getInnerHeight();
if (this.map) {
this.map.width = width;
this.map.height = height;
this.map.resize();
this.map.reposition();
}
} .createDelegate(this))
})
} So, if i resize the panel, the map can be resized and repositioned, the only problem is graphics do not respond accordingly:confused:.
... View more
06-29-2010
05:44 PM
|
0
|
0
|
306
|
POST
|
After the Map Div has been resized, i resized and repositioned the map, but the graphics on the map were not repositioned, why? Anyone knows? How should i do ? Thanks a lot! Here are my snapshots (look at the position of graphics): Before Resized After Resized
... View more
06-29-2010
03:20 AM
|
0
|
4
|
712
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|