[OpenLayers-Users] map scope problem

Pierre GIRAUD bluecarto at gmail.com
Wed Oct 22 05:43:50 EDT 2008


First, I don't think we're able to find your scope problem if you
don't provide more code.

In the mean time, I wonder why you are using your own XmlHttp requests
handler. There are ready to use classes in OpenLayers that can help
you writing AJAX code.
Please have a look at the AJAX class and at the OpenLayers.loadURL
method. This should help you.

If you still have problems with scopes, come back to us with more code.

Regards,
Pierre

On Wed, Oct 22, 2008 at 7:52 AM, S.Reena <reena at indiamail.com> wrote:
>
> I have used AJAX to load a php file "showmap.php" which makes a database
> table based on selections . I have used that table to create a layer in
> init() function itself which makes the map and rendered it false there using
> wms[8].setVisibility(false). I want that  in openmap() function I just make
> that layer visible...but all the functions called after that php file is
> executed takes map ,vector,wms etc as undefined. How to deal with this?
>
>  function showmap(queryString)
>        {
>
>          var xmlHTTP;
>          xmlHTTP=GetXmlHttpObject();
>
>          if (xmlHTTP==null)
>          {
>              alert ("Your browser does not support AJAX!");
>              return;
>          }
>          xmlHTTP.onreadystatechange=function()
>          {
>             if((xmlHTTP.readyState==4) || (xmlHTTP.readyState=="complete"))
>             {
>                var res=xmlHTTP.responseText;
>                if(res==0)
>                {
>                        openmap();
>                }
>             }
>          }
>         // alert(queryString);
>          xmlHTTP.open("GET", "showmap.php"+queryString, true);
>          xmlHTTP.send(null);
>
>        }
>
> --
> View this message in context: http://www.nabble.com/map-scope-problem-tp20104382p20104382.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



More information about the Users mailing list