[OpenLayers-Users] Is there an easy way to center and zoom the map automatically based on the placemarks that are on it?

Someone azintirea at gmail.com
Mon Jul 9 08:37:35 PDT 2012


I'm getting "undefined" when I try to call kmllayer.features using the
script provided in the last post.  I am able to view the 'feature.geometry'
when the feature is coming from a click event, I just have not figured out
how to get all features available from the kml layer (keeps coming up
undefined no matter what I try).  Any more examples would be greatly
appreciated (working links to complete examples would be awesome[?]), thanks
for what I have gotten so far.

Aaron E-J
http://otherrealm.org
http://aaronej.blogspot.com
Vision without action is a daydream,
Action without vision is a nightmare,
One needs both to succeed.





On Sun, Jul 8, 2012 at 5:05 PM, Phil Scadden [via OSGeo.org] <
ml-node+s1560n4986795h11 at n6.nabble.com> wrote:

> Something like this?  (okay, I do this on a WFS request, rather than a
> layer but principle should apply.
>
>            var fts = layer.features;
>            if (fts.length>0 && fts[0].geometry) {
>                sExt = fts[0].geometry.getBounds().clone();
>                for(var i=1;i<fts.length;i++) {
>                   sExt.extend(fts[i].geometry.getBounds());
>                }
>            }
>
>
> Notice: This email and any attachments are confidential. If received in
> error please destroy and immediately notify us. Do not copy or disclose the
> contents.
>
> _______________________________________________
> Users mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=4986795&i=0>
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://osgeo-org.1560.n6.nabble.com/Is-there-an-easy-way-to-center-and-zoom-the-map-automatically-based-on-the-placemarks-that-are-on-it-tp4985789p4986795.html
>  To unsubscribe from Is there an easy way to center and zoom the map
> automatically based on the placemarks that are on it?, click here<http://osgeo-org.1560.n6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4985789&code=YXppbnRpcmVhQGdtYWlsLmNvbXw0OTg1Nzg5fDcxOTQ1MjAw>
> .
> NAML<http://osgeo-org.1560.n6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


-----
Vision without action is a daydream,
Action without vision is a nightmare,
One needs both to succeed.
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Is-there-an-easy-way-to-center-and-zoom-the-map-automatically-based-on-the-placemarks-that-are-on-it-tp4985789p4986986.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120709/957b9587/attachment-0002.html>


More information about the Users mailing list