BUG: OpenLayers.LonLat.Lon - only with IE 6

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

BUG: OpenLayers.LonLat.Lon - only with IE 6

Richard Thurbin
Sorry, I don't know if this is the right way to use this... I would like to
report a bug I have found when using the OpenLayers API.

I have searched the FAQ, Wiki engine, current tickets, Google and have not
found any reference to this.

Using the code taken from your very own tutorial...

//Stuff setting up the maps...

OpenLayers.Event.observe($('map'),"click",mapclicked.bindAsEventListener(map
));

function mapclicked(e){
        var lonlat = map.getLonLatFromPixel(e.xy);                
        var foo = lonlat.lon + "," + lonlat.lat;
};

//end

Works perfectly with IE7, Firefox 2.0.x but with IE 6.0.3790.1830 it has a
scripting error "Error 'lon' is null or not an object".

It is prevalent in OpenLayers version 2.3 (stable), 2.3 (Latest) and the
hosted version.

My customer uses IE6 and their IT department wont use FireFox due to
'security issues'. Ironic, I know but the customer is always right.

Anyway, can someone get back to me about this please? I can demonstrate this
if it would be helpful but it will involve giving out passwords to a secure
site. Please contact me on any of the channels below.

Regards,
Richard Thurbin    
Technical Director

Mobile: +44 7917 704 145
VOIP:   +44 8458 905 299
Fax:    +44 8700 518 913
Email:  [hidden email]

Cloud Amber Research and Development
Amber House
Brockley Road
Elsworth
Cambridge
CB23 4JS
United Kingdom

http://www.cloudamber.com
http://www.carboncalculator.info
http://www.qbust.info 


_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: BUG: OpenLayers.LonLat.Lon - only with IE 6

Erik Uzureau-3
as the resident OpenLayers IE6  lackey, my interest is piqued. Can you please
either send an URL to the list that demonstrates this problem or contact me
personally (passwords, etc)

Thanks!
Erik

On 3/14/07, Richard Thurbin <[hidden email]> wrote:

> Sorry, I don't know if this is the right way to use this... I would like to
> report a bug I have found when using the OpenLayers API.
>
> I have searched the FAQ, Wiki engine, current tickets, Google and have not
> found any reference to this.
>
> Using the code taken from your very own tutorial...
>
> //Stuff setting up the maps...
>
> OpenLayers.Event.observe($('map'),"click",mapclicked.bindAsEventListener(map
> ));
>
> function mapclicked(e){
>         var lonlat = map.getLonLatFromPixel(e.xy);
>         var foo = lonlat.lon + "," + lonlat.lat;
> };
>
> //end
>
> Works perfectly with IE7, Firefox 2.0.x but with IE 6.0.3790.1830 it has a
> scripting error "Error 'lon' is null or not an object".
>
> It is prevalent in OpenLayers version 2.3 (stable), 2.3 (Latest) and the
> hosted version.
>
> My customer uses IE6 and their IT department wont use FireFox due to
> 'security issues'. Ironic, I know but the customer is always right.
>
> Anyway, can someone get back to me about this please? I can demonstrate this
> if it would be helpful but it will involve giving out passwords to a secure
> site. Please contact me on any of the channels below.
>
> Regards,
> Richard Thurbin
> Technical Director
>
> Mobile: +44 7917 704 145
> VOIP:   +44 8458 905 299
> Fax:    +44 8700 518 913
> Email:  [hidden email]
>
> Cloud Amber Research and Development
> Amber House
> Brockley Road
> Elsworth
> Cambridge
> CB23 4JS
> United Kingdom
>
> http://www.cloudamber.com
> http://www.carboncalculator.info
> http://www.qbust.info
>
>
> _______________________________________________
> 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
|

Re: BUG: OpenLayers.LonLat.Lon - only with IE 6

Christopher Schmidt-2
In reply to this post by Richard Thurbin
On Wed, Mar 14, 2007 at 09:20:14PM -0000, Richard Thurbin wrote:
> Sorry, I don't know if this is the right way to use this... I would like to
> report a bug I have found when using the OpenLayers API.
>
> I have searched the FAQ, Wiki engine, current tickets, Google and have not
> found any reference to this.

I don't have an easy answer for you, but typically the best way to
register map events is using the map.events.register() call, as in the
click.html example:

  http://openlayers.org/dev/examples/click.html

Erik's expressed an interest in this, and I've already pointed him to
the demo which displays the problem.

So, in the meantime, you can change your code to use map.events.register
as in click.html instead of OpenLayers.Event.observe.

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: BUG: OpenLayers.LonLat.Lon - only with IE 6

Erik Uzureau-3
Yes Hi Richard,
On brief further investigation, chris's insight is the key. You have
to use the standard openlayers events object registering if you want
ot use the .xy property.

If you see this demo in ie6 it does work:
http://openlayers.org/dev/examples/click.html

What you need to do is register your map clicked function like this:

            map.events.register("click", map, function(e) {
                var lonlat = map.getLonLatFromViewPortPx(e.xy);
                alert("You clicked near " + lonlat.lat + " N, " +
                                          + lonlat.lon + " E");
            });

Not sure offhand *why* it should be still working in FF or other ie's
but at any rate, this
should for sure clear up the problem.

Let us know if this isn't the case
erik

On 3/14/07, Christopher Schmidt <[hidden email]> wrote:

> On Wed, Mar 14, 2007 at 09:20:14PM -0000, Richard Thurbin wrote:
> > Sorry, I don't know if this is the right way to use this... I would like to
> > report a bug I have found when using the OpenLayers API.
> >
> > I have searched the FAQ, Wiki engine, current tickets, Google and have not
> > found any reference to this.
>
> I don't have an easy answer for you, but typically the best way to
> register map events is using the map.events.register() call, as in the
> click.html example:
>
>   http://openlayers.org/dev/examples/click.html
>
> Erik's expressed an interest in this, and I've already pointed him to
> the demo which displays the problem.
>
> So, in the meantime, you can change your code to use map.events.register
> as in click.html instead of OpenLayers.Event.observe.
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> 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
|

Re: BUG: OpenLayers.LonLat.Lon - only with IE 6

Richard Thurbin
In reply to this post by Christopher Schmidt-2
Thank you very much Christopher. It now works brilliantly.

Thank you very much also to Erik who gave me some helpful suggestions.

I will try and dig out where I got the tutorial from so it can be updated.

Regards,
Richard Thurbin    
Mobile: +44 7917 704 145
VOIP:   +44 8458 905 299
Fax:    +44 8700 518 913
Email:  [hidden email]

Cloud Amber Research and Development
Amber House
Brockley Road
Elsworth
Cambridge
CB23 4JS
United Kingdom

http://www.cloudamber.com
http://www.carboncalculator.info
http://www.qbust.info 

-----Original Message-----
From: Christopher Schmidt [mailto:[hidden email]]
Sent: 14 March 2007 22:58
To: Richard Thurbin
Cc: [hidden email]
Subject: Re: [OpenLayers-Dev] BUG: OpenLayers.LonLat.Lon - only with IE 6

On Wed, Mar 14, 2007 at 09:20:14PM -0000, Richard Thurbin wrote:
> Sorry, I don't know if this is the right way to use this... I would
> like to report a bug I have found when using the OpenLayers API.
>
> I have searched the FAQ, Wiki engine, current tickets, Google and have
> not found any reference to this.

I don't have an easy answer for you, but typically the best way to register
map events is using the map.events.register() call, as in the click.html
example:

  http://openlayers.org/dev/examples/click.html

Erik's expressed an interest in this, and I've already pointed him to the
demo which displays the problem.

So, in the meantime, you can change your code to use map.events.register as
in click.html instead of OpenLayers.Event.observe.

Regards,
--
Christopher Schmidt
MetaCarta


_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: BUG: OpenLayers.LonLat.Lon - only with IE 6

Erik Uzureau-3
You probably got it from the lonlatfrompx.html file, which is in the
examples directory. It is incorrect and we are going to remove it.

-E

On 3/14/07, Richard Thurbin <[hidden email]> wrote:

> Thank you very much Christopher. It now works brilliantly.
>
> Thank you very much also to Erik who gave me some helpful suggestions.
>
> I will try and dig out where I got the tutorial from so it can be updated.
>
> Regards,
> Richard Thurbin
> Mobile: +44 7917 704 145
> VOIP:   +44 8458 905 299
> Fax:    +44 8700 518 913
> Email:  [hidden email]
>
> Cloud Amber Research and Development
> Amber House
> Brockley Road
> Elsworth
> Cambridge
> CB23 4JS
> United Kingdom
>
> http://www.cloudamber.com
> http://www.carboncalculator.info
> http://www.qbust.info
>
> -----Original Message-----
> From: Christopher Schmidt [mailto:[hidden email]]
> Sent: 14 March 2007 22:58
> To: Richard Thurbin
> Cc: [hidden email]
> Subject: Re: [OpenLayers-Dev] BUG: OpenLayers.LonLat.Lon - only with IE 6
>
> On Wed, Mar 14, 2007 at 09:20:14PM -0000, Richard Thurbin wrote:
> > Sorry, I don't know if this is the right way to use this... I would
> > like to report a bug I have found when using the OpenLayers API.
> >
> > I have searched the FAQ, Wiki engine, current tickets, Google and have
> > not found any reference to this.
>
> I don't have an easy answer for you, but typically the best way to register
> map events is using the map.events.register() call, as in the click.html
> example:
>
>   http://openlayers.org/dev/examples/click.html
>
> Erik's expressed an interest in this, and I've already pointed him to the
> demo which displays the problem.
>
> So, in the meantime, you can change your code to use map.events.register as
> in click.html instead of OpenLayers.Event.observe.
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
>
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev
>
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev