[OpenLayers-Users] Importing JSON to WKT

Joel Leininger leiningr at gmail.com
Tue Jul 10 15:05:26 PDT 2012


Yes, those are exactly the behaviors I see.

Now, the results of the logs:

MULTIPOLYGON(((-8528881.66131028 4765394.13129731,-8528940 ..... (note, no
brackets or quotes)

object

string

On Tue, Jul 10, 2012 at 5:56 PM, Greg Allensworth <gregor at greeninfo.org>wrote:

> On 7/10/2012 2:47 PM, Joel Leininger wrote:
>
>> That's true, we do control both sides of that transaction.
>> Any ideas why we should have to resort to this??
>>
>
> No, it sounds very strange. Looking at the JSON parser source code
>
> I do notice one thing: console.log(updateOutput[0]) is showing
> "["MULTIPOLYGON(((-8528843...**591 4765443.37168208)))"]" with the
> brackets, indicating that it's an array.
>
> What if you do this? Does it show a single string?
> console.log(updateOutput[0][0]**);
>
> What about this?
> console.log(typeof updateOutput[0]);
> console.log(typeof updateOutput[0][0]);
>
>
> And you're sure of the behavior:
>
> // works?
> new polygone = parcer.read("MULTIPOLYGON(((**123 456)))");
>
> // fails?
> var wkt = "MULTIPOLYGON(((123 456)))";
> new polygone = parcer.read(wkt);
>
>
> --
> Greg Allensworth, Web GIS Developer
> BS  A+  Network+  Security+  Linux+  Server+
> GreenInfo Network - Information and Mapping in the Public Interest
> 564 Market Street, Suite 510  San Francisco CA 94104
> PH: 415-979-0343 x302  FX: 415-979-0371    email: gregor at greeninfo.org
> Web: www.GreenInfo.org     www.MapsPortal.org
>
> Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120710/9a2e2817/attachment.html>


More information about the Users mailing list