[OpenLayers-Users] problem consuming escaped single quotes in GeoJSON with a clustered vector layer

Zac Spitzer zac.spitzer at gmail.com
Thu Jun 10 20:34:28 EDT 2010


Hi Eric,

thanks for trying that.

I have created a cut down test case which demonstrates the problem

http://mapguide-central.ennoble.com.au/testcase/geo_json_escaping/testcase.html

there are two vector layers, one which is escaped and one which isn't

the escaped one is on by default and doesn't render

z

On 10 June 2010 17:10, Eric Lemoine <eric.lemoine at camptocamp.com> wrote:
> On Thu, Jun 10, 2010 at 4:28 AM, Zac Spitzer <zac.spitzer at gmail.com> wrote:
>> I have having a problem consuming some GeoJSON,
>> basically the name value in the sample below is causing
>> my vector layer to silently abort rendering.
>>
>> i believe it's valid json, as i can load it into a javascript variable
>> and dump it to the firebug console
>>
>> I'm using trunk Revision: 10300
>>
>> {
>> "type": "FeatureCollection",
>> "features": [
>> { "type": "Feature",
>> "fid": 14583,
>> "geometry": {"type": "Point", "coordinates": [135.4092, -26.461317 ]},
>> "properties": {
>> "name": "3 O\'Clock Creek camping area",
>> "fid": 14583,
>> "icon": "openlayers/23"}
>> }
>> ]}
>>
>>
>> any ideas?
>
> Hi. I just tried with
> <http://openlayers.org/dev/examples/vector-features.html> and it
> worked. Here is what I did:
>
> - open <http://openlayers.org/dev/examples/vector-features.html> in FireFox
> - open the FireBug console and enter:
>
>>>> var format = new OpenLayers.Format.GeoJSON();
>>>> var features = format.read('{"type": "FeatureCollection","features":[{"type": "Feature","fid": 14583,"geometry": {"type": "Point","coordinates": [135.4092, -26.461317 ]},"properties": {"name": "3 O\'Clock Creek camping area","fid": 14583,"icon":"openlayers/23"}}]}');
>>>> map.layers[1].addFeatures(features);
>
> - unzoom to see the Australia, and the point is displayed
>
> So at this point I don't know why you're having problem with this
> GeoJSON string.
>
> --
> Eric Lemoine
>
> Camptocamp France SAS
> Savoie Technolac, BP 352
> 73377 Le Bourget du Lac, Cedex
>
> Tel : 00 33 4 79 44 44 96
> Mail : eric.lemoine at camptocamp.com
> http://www.camptocamp.com
>



-- 
Zac Spitzer
Solution Architect / Director
Ennoble Consultancy Australia
http://www.ennoble.com.au
http://zacster.blogspot.com
+61 405 847 168



More information about the Users mailing list