cyrilcherian

Zooming the selected polygon to the center of .NET WebBrowser control

Discussion created by cyrilcherian on Dec 22, 2012
Hi,
I have a JavaScript API application. I am embedding this page in a .NET WebBrowser Control. The size of the webbrowser control is approximately 300X300 pixel. I have code that query and zoom a polygon geometry.
If I run this page directly in the browser it works fine. Because size of the map is large enough to see the polygon.  But after embedding this page in webbrowser control, selection and zooming works. But the selected feature is not visible in the content of the webbrowser control. If I pan the map, I can see the highlighted polygon.

Basically what I am looking is to zoom the selected polygon to the center of the webbrowser control. I tried by setting the scroll bar of the control false/true. What I see the height of the map fits in the control. but the width of the goes beyond the control. That means if the scroll bar is true, I get horizontal scrollbar.

Tried to use screen co-ordinates and it is not working. Something like panning the polygon to the center of the webbrowser control.

Any help appreciated.

Thanks
Cyril

Outcomes