[OpenLayers-Users] this.initialize is undefined

Arnd Wippermann arnd.wippermann at web.de
Thu Aug 14 17:07:26 EDT 2008


instead format: format, try something like this:

format : 'png',
 
Arnd Wippermann

  _____  

Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Greg Ederer
Gesendet: Donnerstag, 14. August 2008 22:23
An: Christopher Schmidt
Cc: Openlayers Users List
Betreff: Re: [OpenLayers-Users] this.initialize is undefined


Thanks, Chris.

I have modified my JavaScript code as follows:

function init()
{
  format = 'image/png';
  map = new OpenLayers.Map("map");
  wms = new OpenLayers.Layer.WMS(
                    "esv:countries - Tiled",
"http://localhost:8080/geoserver/wms" <http://localhost:8080/geoserver/wms>
,
                    {
                        styles: '',
                        layers: 'esv:countries',
                        width: '800',
                        height: '362',
                        srs: 'EPSG:4326',
                        format: format,
                        tiled: 'true',
                        tilesOrigin : "-198,-98.68117980957031"
                    },
                    {buffer: 0}
                );

      
  map.addLayer(wms);
}

The page now loads without errors, and the pan and zoom controls are
displayed; but the esv:countries layer does not appear.

Any ideas?

Thanks!

Greg

Christopher Schmidt wrote: 

On Thu, Aug 14, 2008 at 01:08:31PM -0700, Greg Ederer wrote:

  

function init()

{

  map = OpenLayers.Map("map");

  wms = new OpenLayers.Layer.WMS(

    



          ^^^ Compare these two lines.





(You're missing a 'new' before the Map() call.)           



Regards,

  



-- 

| E R G O N O S I S

| Greg Ederer

| Lead Developer

| greg at ergonosis.com

| 360.774.6848

|
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080814/c39c11c8/attachment.html


More information about the Users mailing list