New to Maps API... Having problems with a polygon

2 views
Skip to first unread message

Greg

unread,
Jun 27, 2010, 9:55:22 PM6/27/10
to Google Maps JavaScript API v3
Hello,
I'm now to the Google maps API. I've been following examples here:
http://code.google.com/apis/maps/documentation/javascript/overlays.html#Polygons
but have become frustrated because my polygon will not show up! I've
triple checked everything and I think my code is correct.

Here is the page in question. Maybe someone can look at my source and
tell me what I'm doing wrong.
http://www.smashco.com/lb/

Thanks in advance!

Luke Mahé

unread,
Jun 27, 2010, 10:02:39 PM6/27/10
to google-map...@googlegroups.com
Hey Greg,

The problem is that you are calling setMap on the variable 'CarolPark' but your polygon variable is actually 'CarrollPark', so if you just fix up that typo then you should be good :)

Hope this helps.

-- Luke



--
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 google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


Greg

unread,
Jun 27, 2010, 10:21:10 PM6/27/10
to Google Maps JavaScript API v3
Thank you, Luke, good catch! I've fixed that but I still don't see my
polygon! Any other input?

Luke Mahé

unread,
Jun 27, 2010, 11:40:21 PM6/27/10
to google-map...@googlegroups.com
Hey Greg,

It looks like you have your Lat and Lng's the wrong way round :)

new google.maps.LatLng(33.770418, -118.16474)
instead of
new google.maps.LatLng(-118.16474, 33.770418)

-- Luke


On Mon, Jun 28, 2010 at 12:21 PM, Greg <jivemi...@gmail.com> wrote:
Thank you, Luke, good catch! I've fixed that but I still don't see my
polygon! Any other input?

--

Greg

unread,
Jun 27, 2010, 11:44:29 PM6/27/10
to Google Maps JavaScript API v3
I've figured it out. I had the lat and the lng values reversed! DOH!
Reply all
Reply to author
Forward
0 new messages