VML.js - unspecified error

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

VML.js - unspecified error

Jeff Dege
I'm taking a first look at the new Vector stuff, and I'm not getting
very far.

In Renderer/VML.js, is the function supported:

    /**
     * @returns Whether or not the browser supports the VML renderer
     * @type Boolean
     */
    supported: function() {
        var supported = document.namespaces;
        return supported;
    },

This is throwing an "htmlfile: Unspecified error" on the
"document.namespaces".

Using Visual Studio 2005, with it's ASP.NET Development Server, and IE
6.  In this environment, document doesn't have a "namespaces" element.
 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Lennox Antoine
> Sent: Monday, March 19, 2007 10:43 AM
> To: [hidden email]
> Subject: [OpenLayers-Users] Unnecessary WMS Queries?
>
> Hi All,
>
> New to the list. Don't know if this is the appropriate forum, but I
> have been observing the amount of WMS queries that comes across my
> client, and it seems like too much.
>
> Take for example the map on the front page of OpenLayers.org. It's a
> 512x256 map, so I would expect 2 images to cover it, or 6 images in
> the worst case scenario. If I look at Firefox->Tools Menu->Page
> Info->Media tab, I see that it has two requests.
>
> Now I click the plus button on the map to zoom in 1 level, and I would
> expect at most 6 wms tiles to be loaded. Instead 8 wms requests are
> made. I hit the plus again, and 28 WMS requests are generated (intead
> of max 6).
>
> If the image isn't cached up, this causes a lot of WMS traffic to be
> generated on my WMS server, which in turn causes backup since requests
> can't be fulfilled in time. In my case, I am dealing with alot of
> images that won't necessarily be cached up, and need quicker response
> rather than getting coverage. Is there anyway to minimize the amount
> of WMS requests that are being made?
>
> -Lennox
> _______________________________________________
> Users mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/users
>
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: VML.js - unspecified error

Jeff Dege
OK - further exploration.

If I run vectorfeatures.html, it works.

If I convert it to vectorfeatures.aspx, it does not.
 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Jeff Dege
> Sent: Monday, March 19, 2007 12:53 PM
> To: [hidden email]
> Subject: [OpenLayers-Dev] VML.js - unspecified error
>
> I'm taking a first look at the new Vector stuff, and I'm not getting
> very far.
>
> In Renderer/VML.js, is the function supported:
>
>     /**
>      * @returns Whether or not the browser supports the VML renderer
>      * @type Boolean
>      */
>     supported: function() {
>         var supported = document.namespaces;
>         return supported;
>     },
>
> This is throwing an "htmlfile: Unspecified error" on the
> "document.namespaces".
>
> Using Visual Studio 2005, with it's ASP.NET Development Server, and IE
> 6.  In this environment, document doesn't have a "namespaces" element.
>  
> > -----Original Message-----
> > From: [hidden email]
> > [mailto:[hidden email]] On Behalf Of Lennox Antoine
> > Sent: Monday, March 19, 2007 10:43 AM
> > To: [hidden email]
> > Subject: [OpenLayers-Users] Unnecessary WMS Queries?
> >
> > Hi All,
> >
> > New to the list. Don't know if this is the appropriate forum, but I
> > have been observing the amount of WMS queries that comes across my
> > client, and it seems like too much.
> >
> > Take for example the map on the front page of OpenLayers.org. It's a
> > 512x256 map, so I would expect 2 images to cover it, or 6 images in
> > the worst case scenario. If I look at Firefox->Tools Menu->Page
> > Info->Media tab, I see that it has two requests.
> >
> > Now I click the plus button on the map to zoom in 1 level,
> and I would
> > expect at most 6 wms tiles to be loaded. Instead 8 wms requests are
> > made. I hit the plus again, and 28 WMS requests are
> generated (intead
> > of max 6).
> >
> > If the image isn't cached up, this causes a lot of WMS traffic to be
> > generated on my WMS server, which in turn causes backup
> since requests
> > can't be fulfilled in time. In my case, I am dealing with alot of
> > images that won't necessarily be cached up, and need
> quicker response
> > rather than getting coverage. Is there anyway to minimize the amount
> > of WMS requests that are being made?
> >
> > -Lennox
> > _______________________________________________
> > Users mailing list
> > [hidden email]
> > http://openlayers.org/mailman/listinfo/users
> >
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev
>
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Vector layer fails, if constructed before the page has finished loading

Jeff Dege
OK - further info.

You can't declare a vector layer in inline javascript, you have to
declare it in a function that's called by a client-side event.

The vectorfeatures example declares a vector layer in an init()
function, and init() is called on the onload event of <body>.  This
worked.

My ASPX conversion called init() in an emitted Javascript block, placed
near the end of the file
by ClientScript.RegisterStartupScript().  This did not work.

What works:

   <html>
   <head runat="server">
      <title>Untitled Page</title>
      <script type="text/javascript"
src="openlayers/lib/OpenLayers.js"></script>
      <script type="text/javascript">
         <!--
         var map;
         function init(){
            map = new OpenLayers.Map( $('map') );
            var vectorLayer = new OpenLayers.Layer.Vector("Simple
Geometry");
                [...]
         }
         // -->
      </script>
   </head>
   <body onload="init();">
      <form id="form1" runat="server">
      <div id="map"></div>
      </form>
   </body>
   </html>

What doesn't work:

   <html>
   <head runat="server">
      <title>Untitled Page</title>
      <script type="text/javascript"
src="openlayers/lib/OpenLayers.js"></script>
      <script type="text/javascript">
         <!--
         var map;
         function init(){
            map = new OpenLayers.Map( $('map') );
            var vectorLayer = new OpenLayers.Layer.Vector("Simple
Geometry");
                [...]
         }
         // -->
      </script>
   </head>
   <body>
      <form id="form1" runat="server">
      <div id="map"></div>
         <script type="text/javascript" defer="defer">
         init();
         </script>
      </form>
   </body>
   </html>

The vector layer constructor fails, if it's called before the page has
entirely loaded.

None of the other layers I've worked with have this dependency.
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Vector layer fails, if constructed before the page has finished loading

Christopher Schmidt-2
On Mon, Mar 19, 2007 at 03:38:45PM -0500, Jeff Dege wrote:

> OK - further info.
>
> You can't declare a vector layer in inline javascript, you have to
> declare it in a function that's called by a client-side event.
>
> The vectorfeatures example declares a vector layer in an init()
> function, and init() is called on the onload event of <body>.  This
> worked.
>
> My ASPX conversion called init() in an emitted Javascript block, placed
> near the end of the file
> by ClientScript.RegisterStartupScript().  This did not work.

This doesn't surprise me. This thread is now linked from
http://trac.openlayers.org/wiki/VectorFAQ . This actually explains why
Google goes with making people add the xmlns:v to their documents
manually. That might be worth examining as an option for a future
release.

Thanks for the report and resolution info. Sorry I don't have a
workaround to tell you how to fix it.

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev