[OpenLayers-Users] Re: Why does this code not work locally?

dr rykovd at gmail.com
Wed Mar 9 00:05:29 EST 2011


For loading features locally you can try:

lay_vector = new OpenLayers.Layer.Vector("Text Layer");
OpenLayers.Request.GET({
    url: 'map_data.txt',
    success: function(e) {
        doc = e.responseText;
        parser = new OpenLayers.Format.Text();
        lay_vector.addFeatures(parser.read(doc));
    }
}); 

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Why-does-this-code-not-work-locally-tp6115836p6152565.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list