Re: [OpenLayers-Users] BING and OpenLayers

2010-03-23 Thread Eric Lemoine
On Sun, Mar 21, 2010 at 7:47 PM, Roger André ran...@gmail.com wrote:
 Ok, I think I'll take the next step of fining a bug now.

Hi

You need

restrictedExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34)

in the map options, so the WMS layer is restricted to the same extent
as the bing layer.


I closed the ticket as invalid.

Thanks,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] BING and OpenLayers

2010-03-23 Thread Roger André
Thanks!  Appreciate the tip.

Is this documented somewhere?
--

On Tue, Mar 23, 2010 at 1:33 AM, Eric Lemoine
eric.lemo...@camptocamp.com wrote:
 On Sun, Mar 21, 2010 at 7:47 PM, Roger André ran...@gmail.com wrote:
 Ok, I think I'll take the next step of fining a bug now.

 Hi

 You need

 restrictedExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
 20037508.34, 20037508.34)

 in the map options, so the WMS layer is restricted to the same extent
 as the bing layer.


 I closed the ticket as invalid.

 Thanks,

 --
 Eric Lemoine

 Camptocamp France SAS
 Savoie Technolac, BP 352
 73377 Le Bourget du Lac, Cedex

 Tel : 00 33 4 79 44 44 96
 Mail : eric.lemo...@camptocamp.com
 http://www.camptocamp.com

___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] BING and OpenLayers

2010-03-23 Thread Roger André
Hate to report this, but setting restrictedExtent does not resolve the
problem.  While it seems to prevent the WMS layer from being slid off
the BING basemap permanently, the layers still move asynchronously
when the map is panned.  This means that after I am done panning and
let go of the map, I see continued, jerky movement of the layers in
the map interface.

Here's the revised code, with sphericalMercator set to true in the
BING layer instantiation, and restrictedExtent set in the map option.

If you have any additional ideas, I'd be happy to try them.  Otherwise
I'll reopen the ticket.

Thanks.
--

html
head
  titleOpenLayers Example/title
script 
src='http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2mkt=en-us'/script
script src=http://randre-laptop/OpenLayers-2.8/OpenLayers.js;/script
/head
body
  div style=width:80%; height:80% id=map/div
  script defer='defer' type='text/javascript'

  // Code goes here
  var map
  var proj_wgs84 = new OpenLayers.Projection(EPSG:4326);
  var seattle = new OpenLayers.LonLat(-122.3326, 47.5912);

  var options = {
  projection: new OpenLayers.Projection(EPSG:900913),
  units: m,
  maxResolution: 156543.0339,
  maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34),
  restrictedExtent: new OpenLayers.Bounds(-20037508.34,
-20037508.34, 20037508.34, 20037508.34)
  };

  map = new OpenLayers.Map('map', options);

  // create Virtual Earth base layer
  var vemap = new OpenLayers.Layer.VirtualEarth(Virtual Earth,
  { type: VEMapStyle.Aerial,
sphericalMercator: true,
numZoomLevels: 21,
maxExtent: new
OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)
  });


  // create WMS layer
  var zones = new OpenLayers.Layer.WMS(
  Zones,
  http://randre-laptop/cgi-bin/mapserv?;,
  {map: '/var/www/mapfiles/mt_vernon/zones.map',
   layers: ['zones'],
   format: 'image/png',
   transparent: true},
  {'displayInLayerSwitcher': true,
   'isBaseLayer': false,
   'gutter': 256  }
  );

  map.addLayers([vemap, zones]);
  map.setCenter(seattle.transform(proj_wgs84, map.getProjectionObject()), 8);

  /script
/body
/html

On Tue, Mar 23, 2010 at 8:57 AM, Roger André ran...@gmail.com wrote:
 Thanks!  Appreciate the tip.

 Is this documented somewhere?
 --

 On Tue, Mar 23, 2010 at 1:33 AM, Eric Lemoine
 eric.lemo...@camptocamp.com wrote:
 On Sun, Mar 21, 2010 at 7:47 PM, Roger André ran...@gmail.com wrote:
 Ok, I think I'll take the next step of fining a bug now.

 Hi

 You need

 restrictedExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
 20037508.34, 20037508.34)

 in the map options, so the WMS layer is restricted to the same extent
 as the bing layer.


 I closed the ticket as invalid.

 Thanks,

 --
 Eric Lemoine

 Camptocamp France SAS
 Savoie Technolac, BP 352
 73377 Le Bourget du Lac, Cedex

 Tel : 00 33 4 79 44 44 96
 Mail : eric.lemo...@camptocamp.com
 http://www.camptocamp.com


___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] BING and OpenLayers

2010-03-21 Thread Roger André
Ok, I think I'll take the next step of fining a bug now.

Thanks,

Roger
--

On Fri, Mar 19, 2010 at 4:13 PM, Roger André ran...@gmail.com wrote:
 Hi Eric,

 I appreciate the link to documentation, and have tried to apply the
 information it contains.  The best I can do with it is below.  It
 looks ok, until you start to pan the map, at which point the WMS layer
 slides right off.

 html
 head
  titleOpenLayers Example/title
    script 
 src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'/script
    script src=http://openlayers.org/api/OpenLayers.js;/script
    /head
    body
      div style=width:80%; height:80% id=map/div
      script defer='defer' type='text/javascript'

 // Code goes here
 var options = {
  projection: new OpenLayers.Projection(EPSG:900913),
  units: m,
  maxResolution: 156543.0339,
  maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
 20037508.34, 20037508.34)
 };

 map = new OpenLayers.Map('map', options);

 // create Virtual Earth layer
 var vemap = new OpenLayers.Layer.VirtualEarth(Virtual Earth,
  {
     sphericalMercator: true,
     maxExtent: new
 OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)
  });


 // create WMS layer
 var wms = new OpenLayers.Layer.WMS(
    World Map,
    http://labs.metacarta.com/wms/vmap0;,
    {'layers': 'basic', 'transparent': true}
 );

 map.addLayers([vemap, wms]);
 map.zoomToMaxExtent();
      /script
    /body
 /html


 -

 On Sat, Mar 13, 2010 at 12:07 AM, Eric Lemoine
 eric.lemo...@camptocamp.com wrote:

 On Saturday, March 13, 2010, Roger André ran...@gmail.com wrote:
  Hi All,I'm trying to resolve some strange behavior in my OpenLayers map.  
  I am using a BING maps base layer, and a GeoJson feature collection 
  layer.  Both layers display in the map, but the GeoJson layer acts 
  funny.  For one thing, it is slightly offset from where it should be 
  located, and for another, it doesn't move with the BING base layer when I 
  pan the map.
  I am trying to follow the instructions at 
  http://docs.openlayers.org/library/spherical_mercator.html#spherical-mercator,
   which seem to be very well written, but may be slightly out of date?  For 
  example, the doc says to instantiate a new VirtualEarth layer by doing 
  this:
 
  var layer = new OpenLayers.Layer.VirtualEarth(Virtual Earth,
   {     sphericalMercator: true,
       maxExtent: new 
  OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)
   });
 
 
  But the current examples show using this syntax:
 
              var roads = new OpenLayers.Layer.VirtualEarth(Road Map,
                   {  type: VEMapStyle.Shaded,                    
  numZoomLevels: 21  }
              );
 
 
  In any case, I can't seem to figure out how to apply the projection 
  instructions that are on the doc.  Also, I'm not sure if a projection 
  mismatch is causing the problem I'm seeing, but I figure it's a place to 
  start.
 
  Would appreciate some advice regarding how to troubleshoot this.

 Hi

 http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#WhydontmyvectorfeaturesworkoverGoogleYahooVirtualEarthetc.

 (this a link to the old FAQ, as the new one is currently out of order.)

 You should use the EPSG:900913 projection in your map and set
 sphericalMercator to true in your VirtualEarch layer. See the
 spherical-mercator.html example. Also, the vector data (GeoJSON)
 should be in EPSG:900913, unless you reproject it client side. If you
 use either the fixed or BBOX strategy set projection to the your
 data projection (e.g. new OpenLayers.Projection(EPSG:4326)) in the
 layer to havr OpenLayers reproject the data to the map projection
 before adding it to the layer.

 Cheers,

 --
 Eric Lemoine

 Camptocamp France SAS
 Savoie Technolac, BP 352
 73377 Le Bourget du Lac, Cedex

 Tel : 00 33 4 79 44 44 96
 Mail : eric.lemo...@camptocamp.com
 http://www.camptocamp.com

___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] BING and OpenLayers

2010-03-19 Thread Roger André
Hi Eric,

I appreciate the link to documentation, and have tried to apply the
information it contains.  The best I can do with it is below.  It
looks ok, until you start to pan the map, at which point the WMS layer
slides right off.

html
head
  titleOpenLayers Example/title
script 
src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'/script
script src=http://openlayers.org/api/OpenLayers.js;/script
/head
body
  div style=width:80%; height:80% id=map/div
  script defer='defer' type='text/javascript'

// Code goes here
var options = {
  projection: new OpenLayers.Projection(EPSG:900913),
  units: m,
  maxResolution: 156543.0339,
  maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34)
};

map = new OpenLayers.Map('map', options);

// create Virtual Earth layer
var vemap = new OpenLayers.Layer.VirtualEarth(Virtual Earth,
 {
 sphericalMercator: true,
 maxExtent: new
OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)
 });


// create WMS layer
var wms = new OpenLayers.Layer.WMS(
World Map,
http://labs.metacarta.com/wms/vmap0;,
{'layers': 'basic', 'transparent': true}
);

map.addLayers([vemap, wms]);
map.zoomToMaxExtent();
  /script
/body
/html


-

On Sat, Mar 13, 2010 at 12:07 AM, Eric Lemoine
eric.lemo...@camptocamp.com wrote:

 On Saturday, March 13, 2010, Roger André ran...@gmail.com wrote:
  Hi All,I'm trying to resolve some strange behavior in my OpenLayers map.  I 
  am using a BING maps base layer, and a GeoJson feature collection layer.  
  Both layers display in the map, but the GeoJson layer acts funny.  For 
  one thing, it is slightly offset from where it should be located, and for 
  another, it doesn't move with the BING base layer when I pan the map.
  I am trying to follow the instructions at 
  http://docs.openlayers.org/library/spherical_mercator.html#spherical-mercator,
   which seem to be very well written, but may be slightly out of date?  For 
  example, the doc says to instantiate a new VirtualEarth layer by doing this:
 
  var layer = new OpenLayers.Layer.VirtualEarth(Virtual Earth,
   {     sphericalMercator: true,
       maxExtent: new 
  OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)
   });
 
 
  But the current examples show using this syntax:
 
              var roads = new OpenLayers.Layer.VirtualEarth(Road Map,
                   {  type: VEMapStyle.Shaded,                    
  numZoomLevels: 21  }
              );
 
 
  In any case, I can't seem to figure out how to apply the projection 
  instructions that are on the doc.  Also, I'm not sure if a projection 
  mismatch is causing the problem I'm seeing, but I figure it's a place to 
  start.
 
  Would appreciate some advice regarding how to troubleshoot this.

 Hi

 http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#WhydontmyvectorfeaturesworkoverGoogleYahooVirtualEarthetc.

 (this a link to the old FAQ, as the new one is currently out of order.)

 You should use the EPSG:900913 projection in your map and set
 sphericalMercator to true in your VirtualEarch layer. See the
 spherical-mercator.html example. Also, the vector data (GeoJSON)
 should be in EPSG:900913, unless you reproject it client side. If you
 use either the fixed or BBOX strategy set projection to the your
 data projection (e.g. new OpenLayers.Projection(EPSG:4326)) in the
 layer to havr OpenLayers reproject the data to the map projection
 before adding it to the layer.

 Cheers,

 --
 Eric Lemoine

 Camptocamp France SAS
 Savoie Technolac, BP 352
 73377 Le Bourget du Lac, Cedex

 Tel : 00 33 4 79 44 44 96
 Mail : eric.lemo...@camptocamp.com
 http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] BING and OpenLayers

2010-03-12 Thread Eric Lemoine
On Saturday, March 13, 2010, Roger André ran...@gmail.com wrote:
 Hi All,I'm trying to resolve some strange behavior in my OpenLayers map.  I 
 am using a BING maps base layer, and a GeoJson feature collection layer.  
 Both layers display in the map, but the GeoJson layer acts funny.  For one 
 thing, it is slightly offset from where it should be located, and for 
 another, it doesn't move with the BING base layer when I pan the map.
 I am trying to follow the instructions at 
 http://docs.openlayers.org/library/spherical_mercator.html#spherical-mercator,
  which seem to be very well written, but may be slightly out of date?  For 
 example, the doc says to instantiate a new VirtualEarth layer by doing this:

 var layer = new OpenLayers.Layer.VirtualEarth(Virtual Earth,
  { sphericalMercator: true,
  maxExtent: new 
 OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)
  });


 But the current examples show using this syntax:

 var roads = new OpenLayers.Layer.VirtualEarth(Road Map,
  {  type: VEMapStyle.Shaded,
 numZoomLevels: 21  }
 );


 In any case, I can't seem to figure out how to apply the projection 
 instructions that are on the doc.  Also, I'm not sure if a projection 
 mismatch is causing the problem I'm seeing, but I figure it's a place to 
 start.

 Would appreciate some advice regarding how to troubleshoot this.

Hi

http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#WhydontmyvectorfeaturesworkoverGoogleYahooVirtualEarthetc.

(this a link to the old FAQ, as the new one is currently out of order.)

You should use the EPSG:900913 projection in your map and set
sphericalMercator to true in your VirtualEarch layer. See the
spherical-mercator.html example. Also, the vector data (GeoJSON)
should be in EPSG:900913, unless you reproject it client side. If you
use either the fixed or BBOX strategy set projection to the your
data projection (e.g. new OpenLayers.Projection(EPSG:4326)) in the
layer to havr OpenLayers reproject the data to the map projection
before adding it to the layer.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users