[OpenLayers-Users] Is point visible

Сергей Колосов sergey.kolosof at gmail.com
Thu Apr 4 23:36:06 PDT 2013


You can use map.getExtent() to determine current bounds and "contains"
function to check if point is inside it.
Next script listens for map view change and checks point inclusion:

map.events.on({
    "move": function () {
        if (map.getExtent().contains(yourPoint.x, yourPoint.y)) {
            // do whatever you need
        }
    }
});


2013/4/4 Macbeth, Andrew (US SSA) <andrew.macbeth at baesystems.com>

>  I’ve poked around and around and don’t a means to determine whether a
> given point is visible to the user. For example, if the user has scrolled
> the map away from Boston such that it can not be seen, how can I determine
> that?            ****
>
> ** **
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130405/fbb39b2b/attachment-0001.html>


More information about the Users mailing list