[OpenLayers-Users] Result of expression 'map' [undefined] is not an object.

Nicholas Efremov-Kendall n.e.kendall at gmail.com
Sun Oct 4 08:42:51 EDT 2009


Hi all,
I'm getting the following error in what used to be functional code Result of
expression 'map' [undefined] is not an object.

It's breaking on the statement map.addLayer(cities). Here's the exerpted
code that I've added around this. I can add a stripped down version of the
rest, but it's bulky and I've only messed with the following bits. Any
suggestions as to what's causing this error?

var styleMap = new OpenLayers.StyleMap(
{'default':OpenLayers.Util.applyDefaults(
{
       label: '${Name}',
       strokeWidth:1,
       strokeColor:"#CCCCCC",
       fillColor: "green",
})
}
    );
};

var cities = new OpenLayers.Layer.GML ("7th Century Cities",
"data/cities.gml", {
styleMap: styleMap,
projection: new OpenLayers.Projection("EPSG:4326"),
format: OpenLayers.Format.GML,
label: "${Name}",
}
);
map.addLayer(cities);

best and thanks in advance,

-- 
Nicholas Efremov-Kendall
Fulbright Student 2009-2010, Ukraine
nefremov at artsci.wustl.edu
c/o Halyna Yerko
Balzaka 92a, Kv 27
02232
Kyiv, Ukraine
(mob) +380963576524
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091004/32162c58/attachment.html


More information about the Users mailing list