1

I get: Uncaught TypeError: Cannot read property 'x' of undefined at proj4js-combined.js:2720

While executing this code (transforming polygon from one system to another):

Proj4js.defs['EPSG:3765'] = '+proj=tmerc +lat_0=0 +lon_0=16.5 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs';

var source = new Proj4js.Proj('EPSG:3765');
var wgs84 = new Proj4js.Proj('EPSG:4326');

var polygon = Proj4js.transform(source, wgs84, features[0].geometry.Polygon);       

gmlLayer.addFeatures(polygon);
map.addLayer(gmlLayer);
1

You shouldn't be referencing Polygon after geometry.

The code should be

var polygon = Proj4js.transform(source, wgs84, features[0].geometry); 
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.