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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:38:54+00:00 2026-06-12T16:38:54+00:00

I use drop down list on my GMap to chose needed region. It works

  • 0

I use drop down list on my GMap to chose needed region. It works only on Firefox, in other browsers when i chose region it do nothing. Here’s my code:

          $.getJSON("sample2.php", {}, function(data){
          $.each(data.places2, function(i, item){

                // $("#markers1").append('<li><a href="#" rel="' + i + '">' + item.title2 +              '</a></li>');
        $("#markers").append('<option value="' + i+ '">' + item.title2 +'</option>');
        latlngbounds2.extend(new google.maps.LatLng(item.lat2, item.lng2));
        map.setCenter( latlngbounds2.getCenter(), map.fitBounds(latlngbounds2));
        var marker2 = new google.maps.Marker({
            position: new google.maps.LatLng(item.lat2, item.lng2),
            title: item.title2
            // map: map
        });
        arrMarkers2[i] = marker2;
        var infowindow2 = new google.maps.InfoWindow({
            content: "<h3>"+ item.title2 +"</h3>" +"<p>"
        });
        arrInfoWindows2[i] = infowindow2;
    });
});
 }
  $(function  (){

mapInit();

   // $('#markers option').click(function() {
     $("#markers option").live("click", function (){
    var i = $(this).attr("value");
    // Эта строка кода, закрывает все открытые балуны, для открытия выбранного
    for(x=0; x < arrInfoWindows2.length; x++){ arrInfoWindows2[x].close(); }
    //arrInfoWindows2[i].open(map, arrMarkers2[i]);
    map.setZoom(12);
    map.setCenter(arrMarkers2[i].getPosition());
    //  alert(arrMarkers2[i]);
    console.info(arrMarkers2[i]['title']);

});
}); 

This is HTML code:

       <div name="cont" id="container" >
     <select id="markers">
     <option>Select Region</option>
     </select>
      </div>

Can anybody help?

  • 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-06-12T16:38:55+00:00Added an answer on June 12, 2026 at 4:38 pm

    Did you try use change in dropdown instead click in option?

    $("#markers").change(function() {
        var i = $(this).val();
    
        for (x=0; x < arrInfoWindows2.length; x++) {
            arrInfoWindows2[x].close();
        }
    
        map.setZoom(12);
        map.setCenter(arrMarkers2[i].getPosition());
        console.info(arrMarkers2[i]['title']);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use a drop down list, every time i click the content
I want to use strike throught for the text in drop down list. Is
I'm trying to use Dashcode to create a drop-down list for an iPhone Web
I have a drop down list populated from a database. When i use the
I would like to use widgets from jQuery Mobile - buttons, drop down list,
I have a drop down list box here: <select class=CountrySelectList name=CountrySelectList id=CountrySelectList onchange=self.location='setlocale.aspx?returnURL=Default.aspx&amp;localesetting=' +
I am trying to make a report use a drop-down list (select list) for
I am trying to use drop down list widget : $this->widget('ext.multiselect.JMultiSelect',array( 'model'=>$model, 'attribute'=>'attribute', 'data'=>$data,
i want to use parameter choosen in a drop down list in my form,
I'm learning MVC3 and I want my drop down list to use colors as

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.