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

  • Home
  • SEARCH
  • 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 7665479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:34:41+00:00 2026-05-31T14:34:41+00:00

While developing this solution, I learned that API V2 was being deprecated. I’ve since

  • 0

While developing this solution, I learned that API V2 was being deprecated. I’ve since begun work on a version utilizing API V3. This work-in-progress can be found at My New Map. Special thanks are due to David Marland at Hammerspace for accelerating this conversion for me.

I’m down to 3 remaining issues..the first of which I will address in this post.

I am unable to trigger the infowindows I have defined:

 google.maps.event.addListener(polyline, 'click', function(event) {
    if (polyline.Contains(event.latLng)) {
        infowindowInside.open(map,polyline);
    } else {
        infowindowOutside.open(map,polyline);
    }
  });

I am attaching them to a polygon..not a marker. The polygon is written:

var path = [
new google.maps.LatLng(35.950079, -84.104977),
new google.maps.LatLng(35.950774, -84.049702),
new google.maps.LatLng(35.946883, -84.047813),
new google.maps.LatLng(35.945354, -84.045067),
new google.maps.LatLng(35.940907, -84.042149),
new google.maps.LatLng(35.930483, -84.037857),
new google.maps.LatLng(35.939656, -84.037857),
new google.maps.LatLng(35.928120, -84.076309),
new google.maps.LatLng(35.938822, -84.066868),
new google.maps.LatLng(35.950079, -84.104977)];
var polyline = new google.maps.Polygon({path:path, strokeColor: "#FF0000", strokeOpacity: 1.0, strokeWeight: 2, clickable:false});
polyline.setMap(map);

I appreciate any guidance you can provide.

Thank you.

** UPDATED *****

I’ve now modified the code to:

google.maps.event.addListener(polyline, 'click', function(event) {
    if (polyline.ContainsLocation(event.latLng, polyline)) {
        window.alert('inside');//infowindowInside.open(map,polyline);
    } else {
        window.alert('outside');//infowindowOutside.open(map,polyline);
    }
  });

However..still no trigger.

  • 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-31T14:34:43+00:00Added an answer on May 31, 2026 at 2:34 pm

    Possibly because Polygon doesn’t have a “contains” function. You should look at using the Google Maps API Geometry Library, which has a containsLocation function.

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

Sidebar

Related Questions

While developing a firefox extension, I create a wizard window from overlay.js using: this.wizard
While developing an app I came to a point when I realized that I
While developing my app I have come to realize that the majority of my
While developing a new query at work I wrote it and profiled it in
I run into this problem constantly while developing AJAX applications. Let's say I want
I'm developing a lightweight e-commerce solution that uses PayPal as the payment gateway. However,
I ran into this problem while developing in Objective-C for iOS, but this should
While developing a C++ application, I had to use a third-party library which produced
While developing products, we often need to create proprietary tools to test some of
While developing a Grails 1.0.5 app I'm appalled at how slow the grails test-app

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.