- points.each(function(p){
- pointList.push(new OpenLayers.Geometry.Point(p[0],p[1]));
- });
- var linearRing = new OpenLayers.Geometry.LinearRing(pointList).transform(proj_EPSG4326, proj_map);;
- var polygonFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing]),null,style);
- vectorLayer.destroyFeatures();
- vectorLayer.addFeatures([polygonFeature]);
- }
- else
- {
- var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
- var point = new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat);
- var pointFeature = new OpenLayers.Feature.Vector(point,null,style);
- vectorLayer.destroyFeatures();
- vectorLayer.addFeatures([pointFeature]);
+ var freader = new OpenLayers.Format.WKT({
+ 'internalProjection': proj_map,
+ 'externalProjection': proj_EPSG4326
+ });
+
+ var feature = freader.read(wkt);
+ if (feature)
+ {
+ feature.style = {
+ strokeColor: "#75ADFF",
+ fillColor: "#F0F7FF",
+ strokeWidth: 2,
+ strokeOpacity: 0.75,
+ fillOpacity: 0.75,
+ pointRadius: 100
+ };
+ vectorLayer.addFeatures([feature]);
+ }