Google Maps Clustering IE Problem

/Google Maps Clustering IE Problem

If you’re having trouble getting Google Maps marker clustering working on IE8, this little snippet may be of use.

A client recently came to me with an issue whereby Google Maps were showing the clusters on all browsers except Internet Explorer 8, but it’s usually a more straight forward fix than you might think. The issue was with how the browser parses the JavaScript variables in the map points array.

var markers = [fusion_builder_container hundred_percent="yes" overflow="visible"][fusion_builder_row][fusion_builder_column row_column_index="0_1" type="1_1" background_position="left top" background_color="" border_size="" border_color="" border_style="solid" spacing="yes" background_image="" background_repeat="no-repeat" padding="" margin_top="0px" margin_bottom="0px" class="" id="" animation_type="" animation_speed="0.3" animation_direction="left" hide_on_mobile="no" center_content="no" min_height="none"][[123.234,213.345],[672,123,125,554],];

The problem with that array is the trailing comma, something that’s often present when you create an array via a programming loop. Remove it so the array is as follows and you should be good to go. Modern browsers are able to ignore this problem, while some.. not so much!

var markers = [[123.234,213.345],[672,123,125,554]];
2018-02-02T03:09:31+00:00June 10th, 2014|PHP Snippets, Web Programming|0 Comments

About the Author:

Warren Chandler is a freelance web programmer and web developer, based in Frinton on Sea, Essex. Warren specialises in web programming, web design, corporate identity, copy writing, SEO, logo and print media for home, work, and mobile platforms.

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.