Assigning Different Markers in Google Maps
<p>I am working on a project using <strong>Google maps</strong> and <strong>Classic ASP</strong>. The map has various locations which are pulled out of the DB and that is fine and works perfectly. </p>

<p><strong>What I want need to do is assign different markers depending on property type etc.</strong></p>

<p>I have searched and cannot find how to do as my javascript is not great. Any pointers would be gratefully received. I do need to use the following code, but tweaked.</p>

<p><strong>PS:</strong> <em>I have taken the ASP delimiters out as code seemed to be trying to execute :-)</em></p>

<pre><code>var icon = new google.maps.MarkerImage("http://maps.google.com/mapfiles/ms/micons/blue.png",
new google.maps.Size(32, 32), new google.maps.Point(0, 0),
new google.maps.Point(16, 32));
var center = null;
var map = null;
var currentPopup;
var bounds = new google.maps.LatLngBounds();
function addMarker(lat, lng, info) {
    var pt = new google.maps.LatLng(lat, lng);
    bounds.extend(pt);
    var marker = new google.maps.Marker({
        position: pt,
        icon: '../img/map/Bar.png',
        map: map
    });
    var popup = new google.maps.InfoWindow({
        content: info,
        maxWidth: 500
    });
    google.maps.event.addListener(marker, "click", function() {
        if (currentPopup != null) {
            currentPopup.close();
            currentPopup = null;
        }
        popup.open(map, marker);
        currentPopup = popup;
    });
    google.maps.event.addListener(popup, "closeclick", function() {
        map.panTo(center);
        currentPopup = null;
    });
}

function initMap() {
    map = new google.maps.Map(document.getElementById("map"), {
        center: new google.maps.LatLng(0, 0),
        zoom: 14,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        mapTypeControl: false,
        mapTypeControlOptions: {
            style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR
        },
        navigationControl: true,
        navigationControlOptions: {
            style: google.maps.NavigationControlStyle.SMALL
        }
    });
    sSQL = "select id, name, province, lat, lng, map_include, map_type from resort where (map_include = 'Playa Del Ingles' and live = 1) order by id asc"
    Set ors = cn.Execute(sSql)
    do while not ors.eof
    //loop does stuff here which I won't bore you about
    response.write "addMarker(" &amp; lat &amp; "," &amp; lon &amp; ",'&lt;h4 style=""margin-bottom:10px""&gt;" &amp; name &amp; "&lt;/h4&gt;&lt;img class=""prop_img"" src=""../resorts/" &amp; prop_id &amp; "/1.jpg""&gt;&lt;div style=""width:300;float:left""&gt;&lt;strong&gt;" &amp; prop_type &amp; "&lt;/strong&gt;&lt;br /&gt;" &amp; province &amp; "&lt;br /&gt;&lt;a href=""../" &amp; page_url &amp; "/resort.asp?hid=" &amp; prop_id &amp; """&gt;More Details&lt;/a&gt;&lt;/div&gt;')" &amp; VbCrLf &amp; ";"
    ors.movenext
    loop
    center = bounds.getCenter();
    map.fitBounds(bounds);
}
</code></pre>