RadWindow and OpenLayers Map

3 posts, 0 answers
  1. Andreas
    Andreas avatar
    2 posts
    Member since:
    Feb 2011

    Posted 07 Feb 2014 Link to this post

    Hello, I experience incorrect window resize when window placed on top of OpenLayers map. The issue appears with OpenLayers 2.13, in 2.12 it works as expected.

    Here's sample code:

    <%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
      CodeBehind="WebForm2.aspx.cs" Inherits="WebGisGeo.WebForm2" %>

    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
      <script type="text/javascript" src="http://www.openlayers.org/dev/OpenLayers.js"></script>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
      <div id="map" style="width: 800px; height: 800px">
      </div>
      <telerik:RadWindow ID="_wndAttributeEditor" runat="Server" Title="Attribute Editor"
        Width="400" Height="550" VisibleOnPageLoad="false" Behaviors="Move, Resize, Maximize"
        Left="20" Top="170" EnableShadow="true">
        <ContentTemplate>
          <div id="_dvEditorWindowContent">
          </div>
        </ContentTemplate>
      </telerik:RadWindow>
      <input type="button" value="show" onclick="showwnd(); return false;" />
      <script type="text/javascript">
        function showwnd() {
          var editorWindow = $find("<%=_wndAttributeEditor.ClientID%>");
          editorWindow.show();
        }
        function init() {
          map = new OpenLayers.Map({
            div: "map",
            allOverlays: true,
            maxExtent: new OpenLayers.Bounds(1549471.9221, 6403610.94, 1550001.32545, 6404015.8)
          });
        }
      </script>
    </asp:Content>

    Any help appreciated, thanks in advance!
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 07 Feb 2014 Link to this post

    Hello Andreas,

    I would advise that you examine the changelog of the OpenLayers map, because this is most likely an issue with event bubbling. Then the user resizes the RadWindow we need the mouse event, so the RadWindow scripts can resize the control. If the map consumes the event RadWindow will not be notified about it.
    A quick search on the net seems to indicate that the fallThrough property now defaults to false, so mouse and keyboard events do not bubble anymore, so you may want to set it to true explicitly: https://github.com/openlayers/openlayers/blob/master/notes/2.13.md.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andreas
    Andreas avatar
    2 posts
    Member since:
    Feb 2011

    Posted 10 Feb 2014 in reply to Marin Bratanov Link to this post

    problem solved, thank you very mach!
Back to Top