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

The Archive Base Latest Questions

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

I do have a project with about 3000 markers beeing distributed on a Google

  • 0

I do have a project with about 3000 markers beeing distributed on a Google Map. I use jquery-ui-maps together with MarkerClusterer and Filtering for a better presentation.

The “marker Data” is loaded via a JSON file.

If I do include all “infoWindowContent” into the JSON file, it will be to big. I would just like to call a function/load a file with the marker ID and having the content set with the result from the called file.

Here is a brief example of what I am doing right now:

$(function() 
{ 
    $('#map').gmap(
    {
        'disableDefaultUI':false, 
        'zoom': 5,
        'center':'<?=$mylat?>,<?=$mylon?>',
        'callback': function() 
        {
            var tags = [<...GETTING LIST OF AVAILABLE TAGS HERE ... >];
            $.each(tags, function(i, tag) 
            {
                $('#sidebar').append(('<label style="margin-right:5px;display:block;"><input type="checkbox" style="margin-right:3px" value="{0}"/>{1}</label>').format(tag, tag));
            });
            var self = this;
            $.getJSON( '< LOADING JSON FILE )?>', function(data) 
            { 
                $.each( data.markers, function(i, marker) 
                {
                    var tags = marker.tags.split(',');
                    self.addMarker(
                    {
                        'position': new google.maps.LatLng(marker.lat, marker.lon),
                        'icon':marker.icon,
                        'tags':tags
                    })
                    .click(function()
                    {
                        //self.openInfoWindow({ 'content':marker.c}, this); => if supplying Conent in JSON file ... works all right, but JSON file is to BIG

// THIS IS, WHERE I NEED SOME ADVICE ... 
                                         self.openInfoWindow({ 'content':marker.id }, this); 
// I want to load a dynamic content for this ID only, if the marker is clicked and the Info Window will be shown
                    });
                });
                self.set('MarkerClusterer', new MarkerClusterer(self.get('map'), self.get('markers'),
                {
                    'maxZoom':12
                }));
                self.addMarker({ 'icon':'/code/geo/images/gmap_pin_blue.png','position':'<?=$mylat?>,<?=$mylon?>','title':'You are here'}).click(function(){
                    self.openInfoWindow({'content':'Your current position' }, this);
                });
                $('#sidebar').show();
            });

            $('#sidebar input:checkbox').click(function(e) 
            {
                e.preventDefault;
                $('#map').gmap('closeInfoWindow');
                $('#map').gmap('set', 'bounds', null);
                var filters = [];
                $('#sidebar input:checkbox:checked').each(function(i, checkbox) 
                {
                    filters.push($(checkbox).val());
                });

                if ( filters.length > 0 ) 
                {
                    var markerList=[];
                    var i=1;
                    self.find('markers',{'property':'tags','value': filters,'operator':'AND'}, function(marker, isFound)  
                    {
                        if(isFound)
                        {
                            markerList.push(marker);
                            i=i+1;
                        }
                    });
                    var filterInfo = filters.join(' && ');
                    $('#result_selection').html("Current Filter: " + filterInfo + " => Results: " + (i-1));
                    console.log("Current Filter: " + filterInfo + " => Results: " + (i-1));
                    self.get('MarkerClusterer').clearMarkers();
                    self.get('MarkerClusterer').addMarkers(markerList);
                    self.get('MarkerClusterer').redraw_();
                } 
                else 
                {
                    self.get('MarkerClusterer').clearMarkers();
                    $('#result_selection').html('No Filter applied!');

                    $('#map').gmap('set','MarkerClusterer', new MarkerClusterer(self.get('map'), self.get('markers'),
                    {
                        'maxZoom':12
                    }));
                }
                self.addMarker({ 'icon':'/code/geo/images/gmap_pin_blue.png','position':'<?=$mylat?>,<?=$mylon?>','title':'You are here'}).click(function(){
                self.openInfoWindow({'content':'Your Position' }, this);
                });
            });
            return false;
        }
    });
}); 

I found this solution, but how can this be included in above script?
Google Maps V3: Loading infowindow content via AJAX

Thank you!

Christian

  • 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-12T06:26:39+00:00Added an answer on June 12, 2026 at 6:26 am

    OK .. figured it out …

    basically it’s easy, once you know where to aim at.

    After adding the markers, adapt the “listener” (here it’s the click() function) and get your dynamic data via ajax:

    Inside above script:

                    self.addMarker(
                    {
                        'position': new google.maps.LatLng(marker.la, marker.lo),
                        'icon':mico,
                        'tags':tags
                        //, 'bounds': true 
                    })
                    .click(function()
                    {
                        var content = load_content(marker.f);
                        self.openInfoWindow({ 'content': content}, this);
                    });
    

    And here’s the function to get the data loaded via Ajax and return the data:

    function load_content(id){
        var html = $.ajax({
            url: "/getYourDataHere.php?id="+id,
            async: false}).responseText;
        return html;
    }
    

    Maybe this will help someone who is looking for such a solution.

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

Sidebar

Related Questions

We have project with a server witch have about 3000 requests at day from
I have some project about game programming, which have to use blender with phanthom
I'm working on a project about graph-coloring (with GUI). I have a map divided
I am currently working on a project about calculations.I have done the main part
My project is about a school admin I have a page called : createClass.php,
I have a scene in my WPF project with about 2000 different user controls:
I have a question about symfony2. I have a project and I am using
We have a project that’s using many C++11 facilities, and we thought about this
In my current project I have data about colors. Each color is either a
I have a Java project that needs a addon interface. I was thinking about

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.