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 6572453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:00:28+00:00 2026-05-25T15:00:28+00:00

I am using Google API V3 and I want to have a ground overlay

  • 0

I am using Google API V3 and I want to have a ground overlay and on this overlay a polygon which changes color on mouseover. The mouseover event works fine as long as no ground overlay is defined. But if the ground overlay is present the the color does not change on mouseover.

Any suggestions?

Here is an example:

var newark = new google.maps.LatLng(40.740, -74.18);
var imageBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(40.716216,-74.213393),
new google.maps.LatLng(40.765641,-74.139235));

var myOptions = {
zoom: 13,
center: newark,
mapTypeId: google.maps.MapTypeId.ROADMAP
}

var map = new google.maps.Map(document.getElementById("map"), myOptions);

var oldmap = new google.maps.GroundOverlay(
"http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg",
imageBounds);
oldmap.setMap(map);

//Points to create polygon
var points = [
new google.maps.LatLng(40.735657,-74.172367),
new google.maps.LatLng(40.743588,-74.179498),
new google.maps.LatLng(40.732878,-74.182777)
]
//Create Polygon
var poly = new google.maps.Polygon({
    path: points,
    map: map,
    strokeColor: '#ff0000',
    strokeOpacity: 1,
    strokeWeight: 1,
    fillColor: '#ff0000',
    fillOpacity: 1
});

//poly changes color on mouseover
google.maps.event.addListener(poly, 'mouseover', function() {
    poly.setOptions({
        strokeColor: '#0000ff',
        fillColor: '#0000ff'
    });
});

//poly changes color back on mouseout
google.maps.event.addListener(poly, 'mouseout', function() {
    poly.setOptions({
        strokeColor: '#ff0000',
        fillColor: '#ff0000'
    });
});
  • 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-25T15:00:30+00:00Added an answer on May 25, 2026 at 3:00 pm

    Likely you’ll have to create a custom overlay for the background, as you have more control over what map layer the ground overlay sits on.

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

    This is not necessarily the issue as I haven’t tried your code, but a good tactic is to use Firebug’s html inspector to see how the shapes are marked up to see if there is anything you can do with css / javascript to change their precedence.

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

Sidebar

Related Questions

I am using google data api which gives date in datetime format. I want
I want to create Contact on Google Apps. I am Using this API And
i am using google org chart visualization API and i want to have the
I'm using the Google Maps API and have added markers. Now I want to
I have an application which is currently using the google map API. I like
I want to make Task in Google Calendar using Google Calendar API : c#.
I want to create Task in Google Calendar using Google Calendar API.Using C#. Looking
I want to draw multiple circles on a map, using the Google Maps API
In my application i want to get the weather report I'm using http://www.google.com/ig/api?weather= for
I'm using Google Translate API, and if I try to translate Mc Donald's this

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.