Hi
I wish to overlay a US zipcode polygon on google maps , using google
maps api and a mashup. I have mysql as the backend, php on the server
side and javascript on the client side.
the output of the spatially enabled mysql is a AsWKT polygon object.
the data is already in web mercator 900913 projection co-ordinates.
the php json output output is as follows :
"-8563752.67240642 4717403.33737441,-8563760.57609145
4717403.33737561,-8563769.03637394 4717403.91010153,-8563777.49665629
4717405.34191456,-8563785.40034105 4717407.20327131,-8563792.41346968
4717409.49417198,-8563801.76430775 4717413.21688637,-8563808.77743618
4717416.79642042,-8563816.79244003 4717421.3782257,-8563825.03008275
4717426.96230345,-8563832.82244734 4717433.11911049,-8563842.06196517
4717441.71001003,-8563851.41280224 4717452.0190988,-8563856.42217911
4717458.4622845,-8563861.9881533 4717466.3372947,-8563865.10509875
4717471.34866795,-8563869.22391942 4717478.65095904,-8563872.45218419
4717484.95097908,-8563876.90496298 4717494.97374617,-8563880.35586624
4717504.71015785,-8563882.91621364 4717513.15793431,-8563885.14260239
4717522.3216319
I have further exploded the php array to separate out the x & Y
projection co-ordinates.
The X co-ordinates in an array are :
["-8563752.67240642","-8563760.57609145","-8563769.03637394","-8563777.49665629","-8563785.40034105","-8563792.41346968"
The Y co-ordinates array
["4717403.33737441","4717403.33737561","4717403.91010153","4717405.34191456","4717407.20327131","4717409.49417198","4717413.21688637"
I can read the php array as a javascript array using jquery.
this is easily fed to the google map polygon array
var triangleCoords = [
new google.maps.LatLng(25.774252, -80.190262),
new google.maps.LatLng(18.466465, -66.118292),
new google.maps.LatLng(32.321384, -64.75737)
];
however all the inputs are in latitude and longitude.
my question is :
do i need to convert projection co-ordinates 900913 to wgs84 4326.
( latitude, longitude)
is there a build in function in goole maps api to do the conversion or
i have to use Proj4.js
will that not be an overhead.
should i convert to kml and load the polygon overlay .
thanx.
any help is really appreciated.
--
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.