Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1041649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:23:09+00:00 2026-05-16T15:23:09+00:00

The Google Maps API for a Polygon does not offer a drag method. What

  • 0

The Google Maps API for a Polygon does not offer a drag method.

What would be an efficient way of implementing such a feature (i.e., sufficiently optimised so that it would not kill a four year old laptop)?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:23:09+00:00Added an answer on May 16, 2026 at 3:23 pm

    I found the Google Maps V2 Polygon Implementation to be very limiting for the needs I have had and solved it by creating a custom overlay. My group is currently stuck on IE6 so I have yet to migrate over to Google Maps V3 – but taking a quick look at the API shows that you could probably do a similar thing that I did in V2 with V3.

    Essentially the idea is:

    1. Create a Custom Overlay
    2. Populate it with your own SVG/VML Polygons and attach a drag event to this custom polygon object

    Custom Overlays:

    Here is some information to get you started on making your own custom overlay:

    http://code.google.com/apis/maps/documentation/javascript/overlays.html#CustomOverlays


    Creating your own “Dragable” Polygon Object:

    Once you get that down you’ll want to add your own polygons to the custom overlay instead of using GPolygons. I went through the painful process of learning SVG/VML and writing a library to bridge SVG/VML together – you could do that, but I would recommend starting by trying to use another library such as Raphaël.

    http://raphaeljs.com/

    Using Raphaël will save you a whole lot of time trying to figure out how to get cross-browser Vector Graphic (Polygon) functionality – and best of all it supports drag events already, here is an example from their library:

    http://raphaeljs.com/graffle.html

    Once you have a custom overlay and you are able to throw some Raphaël objects onto it the last step is to translate the coordinates you want from a Lat/Lng value to a Pixel value. This is available in the MapCanvasProjection of V3:

    http://code.google.com/apis/maps/documentation/javascript/reference.html#MapCanvasProjection

    You can use fromLatLngToDivPixel to figure out what the actual pixel values are for the points on your Raphael polygon, draw it, then add it to the overlay with a drag event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've added the Google MAPs API to my app, but it's not a critical
Does google maps api support suggestions ? In other terms, can I receive from
Based on the Google Maps JavaScript API v3 documentation , google.maps.Polygon class's getPath() function
Google Maps Api has a google.maps.geometry.spherical.computeArea method. How can I write its equivalent in
I know that google maps provide API for drawing circles, polygons but not ellipse.
I'm using Google Maps API to visualize some label on the map using google.maps.Polygon.
When using Google Maps API with Google Fusion Tables (with API), I would like
It seems that drawing of polygons is asynchronous in google maps api v3 .
Google Maps API V3 doesn't support the V2 GOverviewMapControl option, yet. I've come across
Google Maps API delivers me a string which contains the German letters: ö, ä

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.