Skip to content

Commit

Permalink
Item11187: Adjusted viewport and zoom javascript
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/OpenLayersPlugin@12919 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulAlexander authored and PaulAlexander committed Oct 28, 2011
1 parent f624eda commit c2e09cc
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/Foswiki/Plugins/OpenLayersPlugin.pm
Expand Up @@ -400,7 +400,7 @@ sub _OPENLAYERSMAP {
# push @mapMetadata, "mapHeight:$mapWidth";

my $mapViewPort = $params->{viewport};
$mapViewPort = '159,-32' unless defined $mapViewPort;
$mapViewPort = '149.128847,-35.28052' unless defined $mapViewPort;
# push @mapMetadata, "mapViewPort:$mapViewPort";
if ($mapViewPort =~ /$params->{layertopics}/) {
$viewPortLayer = 'true';
Expand Down Expand Up @@ -649,17 +649,13 @@ HERE


push @scriptVariable, <<"HERE";
// if (map.isValidLonLat(viewportcorner) && $mapViewPortZoom) {
// map.moveTo(viewportcorner,$mapViewPortZoom);
// }
var viewportcorner = new OpenLayers.LonLat($mapViewPort);
var proj = new OpenLayers.Projection("EPSG:4326");
if (map.isValidLonLat(viewportcorner) && $mapViewPortZoom) {
var point = new OpenLayers.LonLat(viewportcorner);
if (map.isValidLonLat($mapViewPort) && $mapViewPortZoom) {
var point = new OpenLayers.LonLat($mapViewPort);
point.transform(proj, map.getProjectionObject());
map.setCenter(point, 4);
//map.moveTo(viewportcorner,$mapViewPortZoom);
map.setCenter(point, $mapViewPortZoom);
//map.moveTo($mapViewPort,$mapViewPortZoom);
}
map.render('$mapElement');
Expand Down

0 comments on commit c2e09cc

Please sign in to comment.