AjaxMapControl Problem

Topics: Web Controls
Jun 24, 2007 at 5:58 PM
Edited Jun 24, 2007 at 5:59 PM
HI.
I try to use AjaxMapControl and it works pretty good.
But when i tried to put it inside the cell of html table, it start do troubles.
When I click on the control to zoom in, the center will change and I got another coordinate...
Can anybody help me to repair this problem?
Jun 25, 2007 at 2:09 PM
Hi again.
I cheked this a little bit deeper and i found that the problem not relevant to html table.
The problem of shifted center appear when you have a scroll bar in the page and you move this scroll bar.
Has anybody encountered this problem?
Jun 26, 2007 at 8:35 AM

MisterMinister wrote:
Hi again.
I cheked this a little bit deeper and i found that the problem not relevant to html table.
The problem of shifted center appear when you have a scroll bar in the page and you move this scroll bar.
Has anybody encountered this problem?


Hi MisterMinister,
you can solve the problem inserting the AjaxMap control on top and left of your cell, without any space on top and on left. Try this solution, I had the same problem and I solved as above.
Sep 7, 2007 at 1:41 AM
Hi MisterMinister

Change the function code to the following in AjaxMap.js:

function SharpMap_GetRelativePosition(x,y,obj)
{
var scrly = typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement.scrollTop;
var scrlx = typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement.scrollLeft;

var position=WebForm_GetElementPosition(obj);
var p=new Object();
p.x=(x-position.x)+scrlx;
p.y=(y-position.y)+scrly;
return p;
}