Some of these may be of use...

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/indexOf
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/substring
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/split
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseFloat

On Mon, Feb 28, 2011 at 6:18 PM, Silver <[email protected]> wrote:

> Hello friends,
> I have a MySQL table for storing polygons for each country's state.
> ---
> idregion, int, autoincrement
> region, varchar(50)
> polygon: geometry
> ---
>
> From PHP I'm getting a json response with the polygon coordinates as
> string:
> "SELECT region, AsText(polygon) FROM regions"
> Like this:
> [{'region':'state 1','polygon':'POLYGON(5 3,8 4,5 5,2 9)'},
> {'region':'state 2','polygon':'POLYGON(2 3,7 1,9 7,1 3)'},...]
>
> Now, for showing the polygon using the Google Maps API I need to
> remove the first portion of the string and parse the rest twice for
> creating a LatLng set.
>
> Can somebody suggest to me a best way for creating a polygon from a
> GEOMETRY MySQL field?
> Regards!!!!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>


-- 
http://twitter.com/broady

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to