<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY>
<DIV>I am wrestling with a similar problem. I am trying to read in data coming from an ArcGIS Server in JSON format. Unfortunately, ArcGIS Server doesn't serve GeoJSON. Here is a sample of what the data looks like:</DIV>
<DIV> </DIV>
<DIV>{<BR> "results" : [<BR> {<BR> "layerId" : 0, <BR> "layerName" : "Main_Gates", <BR> "displayFieldName" : "road_name", <BR> "foundFieldName" : "farm_id", <BR> "value" : "AS00136", <BR> "attributes" : {<BR> "point_location_id" : "232495", <BR> "farm_id" : "AS00136", <BR> "rapid_no" : "104", <BR> "road_name" : "Winslow Willowby Rd", <BR> "locality" : "Null", <BR> "x_nztm" : "1492934.61", <BR> "y_nztm" : "5131545.29", <BR> "Shape" : "Point"<BR> }, <BR> "geometryType" : "esriGeometryPoint", <BR> "geometry" : <BR> {<BR> "x" : 1492934.61, <BR> "y" : 5131545.29, <BR> "spatialReference" : {<BR> "wkid" : 2193<BR> }<BR> }<BR> }<BR> ]<BR>}<BR></DIV>
<DIV>Any ideas how to get OL to read this into a Vector layer?</DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV> </DIV>
<DIV>Robert<BR>>>> "Arnd Wippermann" <arnd.wippermann@web.de> 7/03/2010 10:43 a.m. >>><BR></DIV>
<DIV dir=ltr align=left><DEFANGHTML_SPAN class=375564121-06032010><FONT face=Arial color=#0000ff size=2>Hi,</FONT></DEFANGHTML_SPAN></DIV>
<DIV dir=ltr align=left><DEFANGHTML_SPAN class=375564121-06032010><FONT face=Arial color=#0000ff size=2></FONT></DEFANGHTML_SPAN></DIV>
<DIV dir=ltr align=left><DEFANGHTML_SPAN class=375564121-06032010><FONT face=Arial color=#0000ff size=2>i would think, that you have to use geojson instead of json, to get the geometry for the features.</FONT></DEFANGHTML_SPAN></DIV>
<DIV dir=ltr align=left><DEFANGHTML_SPAN class=375564121-06032010><FONT face=Arial color=#0000ff size=2></FONT></DEFANGHTML_SPAN></DIV>
<DIV dir=ltr align=left><DEFANGHTML_SPAN class=375564121-06032010><FONT face=Arial color=#0000ff size=2>Arnd</FONT></DEFANGHTML_SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> users-bounces@openlayers.org [mailto:users-bounces@openlayers.org] <B>Im Auftrag von </B>Hugo<BR><B>Gesendet:</B> Samstag, 6. März 2010 19:14<BR><B>An:</B> openlayers<BR><B>Betreff:</B> [OpenLayers-Users] Make vector layer from JSON<BR></FONT><BR></DIV>
<DIV></DIV>Hello all,<BR><BR>I'm trying to create a vector layer based on a php query (which includes the_geom) encoded in JSON. Until the moment i haven't been able to achieve this.<BR>Following, is the relevant part of the code:<BR><BR>var connect = new Ext.data.Connection();<BR>connect.request({<BR> url: 'mfbase/geoquery.php',<BR> params: {<BR> species: species,<BR> datai: datai,<BR> dataf: dataf<BR> },<BR> success: function(response){<BR> var resp = response.responseText;<BR> var json = new OpenLayers.Format.JSON();<BR> var data = json.read(resp);<BR> //console.log(data[0].the_geom);<BR> <BR> var querylayer1 = new OpenLayers.Layer.Vector(<BR> 'Query1',<BR> {<BR> isBaseLayer: false,<BR> projection: wgs,<BR> geometryName: 'the_geom',<BR> }<BR> );<BR> <BR> querylayer1.addFeatures(data);<BR> map.addLayer(querylayer1);<BR> }<BR>})<BR clear=all><BR>Any suggestions are more than welcomed :)<BR>Thanks to you all!<BR><BR>Cheers,<BR><BR><BR>-- <BR>Hugo Martins<BR>FMV-UTL<BR>CIISA-Epidemiologia e Saúde Pública Veterinária<BR>Av. da Universidade Técnica<BR>1300-477 Lisboa<BR>N 38°42'49.54", W 9°11'43.42"<BR><BR><BR><FONT style="BACKGROUND-COLOR: #ffffff">
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">Click <A href="https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg==">here</A> to report this email as spam.</FONT></P></FONT><br><br><table bgcolor=white style="color:black"><tr><td><br>------------------------------------------------------------------<br>
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.<br>
------------------------------------------------------------------</td></tr></table><br><br>
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">This message has been scanned for malware by SurfControl plc. </FONT><A href="http://www.surfcontrol.com/"><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000>www.surfcontrol.com</FONT></A></P>
</body></HTML>