Pmapper5: zoom to selected features

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Pmapper5: zoom to selected features

gioza
Hi,
in pmapper5 using the search box or select by shape, have any of you realised that the function "zoom to selected features" doesn't display the complete extent of selected items?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pmapper5: zoom to selected features

gioza
I figured out with a change to pm.map.js:

add to line 162->166 the map.zoomOut() control in this way:

FROM
  zoom2extent: function(layer, idx, extStr, zoomfull) {
    var ext = extStr.split(",");
                map.zoomToExtent( new OpenLayers.Bounds(ext[0], ext[1], ext[2], ext[3]), true );
                    },


TO
  zoom2extent: function(layer, idx, extStr, zoomfull) {
    var ext = extStr.split(",");
                map.zoomToExtent( new OpenLayers.Bounds(ext[0], ext[1], ext[2], ext[3]), true );
                map.zoomOut();
    },

As you select a features by "search tools" the zoomToextent will zoom out so that all the features you selected with the query are completely visible
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pmapper5: zoom to selected features

gioza
for better performance add PM.Map.clearHighlight in pm.query.js in this way:

after line 81

 execute: function(queryUrl, queryParams) {
        PM.Map.clearHighlight();
        var self = this;
...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pmapper5: zoom to selected features

gioza
a much better solution for my work is to modify pm.map.js in this way:

line 162

 zoom2extent: function(layer, idx, extStr, zoomfull) {
    var ext = extStr.split(",");
               
                var minx = (ext[0]*0.9995);
                var miny = (ext[1]*0.9995);
                var maxx = (ext[2]*1.0005);
                var maxy = (ext[3]*1.0005);
               
                map.zoomToExtent( new OpenLayers.Bounds(minx, miny, maxx, maxy), true );
                 
                               
    },

the previous solution gives problem with History Navigation...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pmapper5: zoom to selected features

gioza
according to your project extension you have to set the coefficent which adjust the extent of the selected features:

var minx = (ext[0]*0.9999);
                var miny = (ext[1]*0.9999);
                var maxx = (ext[2]*1.0001);
                var maxy = (ext[3]*1.0001);
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] Pmapper5: zoom to selected features

Armin Burger
In reply to this post by gioza
an even better solution is to use the config parameters
  <pointBuffer>
  <shapeQueryBuffer>

and adapt them to the coordinate system used for your map and typical
scales used for tour application...




On 10/10/2014 09:06 PM, gioza wrote:

> a much better solution for my work is to modify pm.map.js in this way:
>
> line 162
>
>   zoom2extent: function(layer, idx, extStr, zoomfull) {
>       var ext = extStr.split(",");
>
> var minx = (ext[0]*0.9995);
> var miny = (ext[1]*0.9995);
> var maxx = (ext[2]*1.0005);
> var maxy = (ext[3]*1.0005);
>
> map.zoomToExtent( new OpenLayers.Bounds(minx, miny, maxx, maxy), true );
>
>
>      },
>
> the previous solution gives problem with History Navigation...
>
>
>
> --
> View this message in context: http://pmapper-users-p-mapper-users-mailing-list.993774.n3.nabble.com/Pmapper5-zoom-to-selected-features-tp4025486p4025634.html
> Sent from the pmapper-users -- p.mapper users mailing list mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://p.sf.net/sfu/Zoho
> _______________________________________________
> pmapper-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://p.sf.net/sfu/Zoho
_______________________________________________
pmapper-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmapper-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pmapper-users] Pmapper5: zoom to selected features

gioza
I khow but it doesn't work for "selected features" using the search tool
Loading...