I've got a directory channel, and each entry has been manually geocoded onto a map with the Google Maps for ExpressionEngine fieldtype. I now want to plot these 1,000 entries onto a single map in the most efficient way, and each category of entry has a different marker (6 categories in total).
Here's the code I'm using with Google Maps for EE:
{exp:gmap:init id="map1" class="gmap" scrollwheel="false" style="width:940px;height:500px" latitude="35.0000" longitude="25.0000"}
{exp:channel:entries channel="directory" status="open" disable="category_fields|member_data|pagination" limit="1000" dynamic="no" sort="asc" search:cf_directory_map_latitude="not IS_EMPTY"}
{categories show_group="2" limit="1"}
{cf_directory_map_location id="map1" show_one_window="true" icon="{category_image}" infobox="true" offsetY="-35" offsetX="15" closeBoxMargin="5px" class="ui-infobox-dark" closeBoxURL="/themes/third_party/gmap/css/images/white-close-button.png" style="width: '300px'" alignBottom="false" clearanceX="10" show_one_window="true" extend_bounds="false"}
<h3>{title}</h3>
<p><strong>City: </strong>{cf_directory_city}<br />
<strong>Type: </strong>{category_name}</p>
<p><a href="{cf_directory_website}" target="_blank">Visit Website »</a></p>
{/cf_directory_map_location}
{/categories}
{/exp:channel:entries}
The above works, but I feel that the code it's outputting is bloated when outputting so many entries. Every marker on the map is outputting its own script tag that is 45 lines long. So multiply this by 1,000 entries, and you end up with 1,000 sets of script tags, and 45,000 lines of code, which means that the page can be a few megabytes in size and slow to load, even when using caching.
Is there a more efficient way of plotting entries onto a map with this add-on? Or if not, is there an easy alternative that I can use which makes use of the data I already have for each entry (the Google Maps for EE field, or else the standard latitude/longitude fields)? Thanks for any advice.