[OpenLayers-Users] Strange behaviour after panning

Pedro Simonetti Garcia pedrosimonetti at gmail.com
Wed Apr 9 21:15:14 EDT 2008


>
> > In any case: We providedd getLonLatFromPixel as the main 'API' property
> > > so that people wouldn't have to use a funky-named property: it's a
> > > wrapper around getLonLatFromViewPortPx.
> > >
> >
> > Just a suggestion. Considering that the "getLonLatFromPixel " is a
> > wrapper around "getLonLatFromViewPortPx", why not renaming it as
> > "getLonLatFromPixel", and use this in the rest of the library?
>
>
> The biggest reason is the same reason we maintain a difference between
> getPixelFromLonLat and its underlying function call: in that case, we
> (just today) changed the underlying method to not round numbers, but we
> can change the API wrapper so that it continues to behave the same, with
> no affect on existing applications. If, for example, we wanted to change
> the library in the future so that getLonLatFromPixel could, as an
> option, transform from the map projection to an actual lon/lat, we could
> do this in tis function without affecting the rest of the library.
>
>
> > As JavaScript is a interpreted language, all function calls has a cost,
> > and because of this, is not recommended to use wrappers and getters
> > since they will just call another function, with a higher performance
> cost.
>
>
> This performance cost is not important in the big sheme of things. A
> single DOM reflow can be hundreds of times more expensive than a
> function call. There is no real reason to change this from the way it
> currently is.
>

Yeah, you're right. Such change would require a lot of work, and the
befenits would be almost imperceptible, since the bottleneck of
performance in web applications is more related to DOM operations,
as you stated. So, looking more carefully to it, I also think that it
wouldn't worth doing this.

But, anyway, I was just sharing my thoughts with you developers.

Thanks for your considerations.

regards,

Pedro Simonetti.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080409/43c6d64f/attachment.html


More information about the Users mailing list