[OpenLayers-Users] Zoom to feature and highlight it

Lee Meilleur lee.meilleur at gis.leg.mn
Wed Aug 19 14:52:33 EDT 2009


Ken,

I'm a newbie with openlayers, but below is a snippet of the javascript I'm working on.   One problem is that I cannot control the zooming/panning after selecting and zooming to the feature.  The options are basically frozen.  That and it actually zooms in closer than the boundary of the selected feature.  Does anyone have any thoughts on why this happening?

Thanks,

Lee


<script type="text/javascript">
var map, layer;

function init(){
    var options = {
    projection: new OpenLayers.Projection("EPSG:26915"),
    maxExtent: new OpenLayers.Bounds(155791.714648, 4720323.238005, 794359.124023, 5570749.155271),
    maxResolution: "auto",
    numZoomLevels: 20,
    units: 'm'
    };
    map = new OpenLayers.Map( 'map', options );
    layer = new OpenLayers.Layer.MapServer( "Test Map", "http://localhost/cgi-bin/mapserv",
    {map: '/OpenLayers/mapfiles/test.map',
    mode: 'itemquerymap',
    qstring: "(name = 'SomeValue')",
    qlayer: 'layername',
    mapxy: 'shape'},
    {singleTile: true} );
    map.addLayer(layer);
    map.zoomToMaxExtent();
    }

    </script>

-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On Behalf Of kennyken
Sent: Wednesday, August 19, 2009 8:18 AM
To: users at openlayers.org
Subject: [OpenLayers-Users] Zoom to feature and highlight it



Here is what I'm trying to do.
I have google maps as my base layer.  Then I have a polygon layer on top of that. What I'm trying to do is link to a particular polygon and highlight it via a hyperlink somewhere on my website.

For example I would have a link similar to http://mywebsite/map.html/polygonIDNumber/

That would then open the map and zoom to and highlight the polygon that is identified in the URL. I've look at several example and I can't find what I'm looking for. Any help would be appreciated.

--
View this message in context: http://n2.nabble.com/Zoom-to-feature-and-highlight-it-tp3472183p3472183.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