First of all, you should have read the posting guidelines (http:// groups.google.com/group/Google-Maps-API/web/suggested-posting- guidelines?hl=en). Post a link, not source code.
Second, this doesn't appear to be a mapplet. Looks like a Maps API page to me. Third, it almost seems to me as though you've answered your own question. You're already using a custom icon referencing your own PNG. If you want different icons, create different PNGs, and use the appropriate one for each category, rather than always using the same one. String On Feb 10, 3:28 pm, King Slim <[email protected]> wrote: > Hi > > I've just made a maplet that dynamically renders formatted html code > from an MS Access MDB into the <head> section of my google map code. > > The data represents several categories of work which I would like to > incorporate into the map as different marker icons. > > Note that I am using my own png file (http://www.archaeologyse.co.uk/ > images/GoogleButton.png) as a marker and wish to create new pngs for > each category) > > How can I modify this Map scenario to show a different marker for each > category? > > Many thanks > > Dylan > > My Code Below > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml"> > > <!—THE FOLLOWING CODE CREATES AN HTML FORMATTED SLICE OF DATA FROM THE > DB AS A VARIABLE CALLED “COLLECT”--> > <% > Dim Serv, Conn, RecordView, SQL, arc_point_value, WGS84x1, WGS84y1, > Title, Town, collect, collect2, output1 > > Serv= "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath > ("/ASE GOOGLE DATABASE LOCALHOST/ReportLibraryTemp.mdb") & ";" > Set Conn = Server.CreateObject("ADODB.Connection") > Set RecordView = Server.CreateObject("ADODB.Recordset") > > Conn.Open Serv > SQL="SELECT * FROM BoundReportList2" > > RecordView.Open SQL, Conn > > arc_point_value=0 > Do While Not RecordView.EOF > WGS84x1=RecordView("WGS84x1") > WGS84y1=RecordView("WGS84y1") > Title=RecordView("Title") > Town=RecordView("Town") > > <!—THE FOLLOWING CODE FORMATS THE DATA INTO A GOOGLE-MAP FORMAT AS A > VARIABLE CALLES “COLLECT”--> > collect = collect & "arc_point[" & arc_point_value & "] = new Array(" > & WGS84x1 & "," & WGS84y1 & ", icon0, '" & Title & "', '<strong>" & > Title & "</strong>,"& Town & ".<br />');" > > arc_point_value = arc_point_value +1 > RecordView.MoveNext > Loop > > RecordView.Close > > Set RecordView = Nothing > Set Conn = Nothing > %> > > <head> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> > <title>Archaeology South-East: Archaeological Projects</title> > > <script src="http://maps.google.com/maps? > file=api&v=2&key=ABQIAAAA2QewiWT- > F-8PZD9RK8XpQBSFAhmv2p7BMQjCh2WjIDhIGsllCRSxSS0_3vCH9Yab4mTCut_eSIXOIg" > type="text/javascript"> > > </script> > > <!--THIS IS THE CODE FOR CREATING GOOGLE MAPS...--> > <script type="text/javascript"> > > var map; > var icon0; > var arc_point = new Array(); > var gmarkers = []; > var t = 0; > var zoom = 7; > > function addLoadEvent(func) { > var oldonload = window.onload; > if (typeof window.onload != 'function'){ > window.onload = func > } else { > window.onload = function() { > oldonload(); > func(); > } > } > > } > > addLoadEvent(loadMap); > addLoadEvent(addPoints); > > function loadMap() { > map = new GMap2(document.getElementById("googlemap")); > map.addControl(new GSmallMapControl()); > map.addControl(new GMapTypeControl()); > map.setCenter(new GLatLng( 50.991174,0.378192), 8); > map.setMapType(G_SATELLITE_MAP); > > icon0 = new GIcon(); > icon0.image = "http://www.archaeologyse.co.uk/images/ > GoogleButton.png"; > icon0.shadow = "http://www.archaeologyse.co.uk/images/ > GoogleButton.png"; > icon0.iconSize = new GSize(8, 8); > icon0.shadowSize = new GSize(8, 8); > icon0.iconAnchor = new GPoint(4, 4); > icon0.infoWindowAnchor = new GPoint(20, 4); > icon0.infoShadowAnchor = new GPoint(8, 8); > > } > > function addPoints() { > > // Add an encoded polyline. > var encodedPoints = "ajluh...@x^mse{m}sbgd@q...@os@ybH"; > var encodedLevels = "BBBBB"; > > var encodedPolyline = new GPolyline.fromEncoded({ > color: "#FF0000", > weight: 10, > points: encodedPoints, > levels: encodedLevels, > zoomFactor: 32, > numLevels: 4 > }); > map.addOverlay(encodedPolyline); > > <!—THE CODE IS FORMATTED TO BE INSERTED HERE USING THE “COLLECT” > VARIABLE IN THE FOLLOWING FORMAT > arc_point[0] = new Array(50.991174,0.378192, icon0, 'An archaeological > Watching Brief at the Bank Building, High Street, Burwash, East > Sussex', '<strong><a href=../ReportLibrary/2006/2559-High-Street- > Burwash-report[2].pdf>An archaeological Watching Brief at the Bank > Building, High Street, Burwash, East Sussex</a></strong>, Burwash.<br / > > >'); > > arc_point[1] = new Array(50.693906,0.097978, icon0, 'St Leonards > Church, Seaford Archaeological monitoring: A brief report on the > findings', '<strong><a href=../ReportLibrary/2006/2612-St-Leonards- > Seaford-Report-(N).pdf>St Leonards Church, Seaford Archaeological > monitoring: A brief report on the findings</a></strong>, Seaford.<br />'); > etc….--> > > <%=collect%>; > > for(var i = 0; i < arc_point.length; i++) { > var point = new GPoint(arc_point[i][1],arc_point[i][0]); > var popuphtml = arc_point[i][4] ; > var marker = createMarker(point,arc_point[i][2],popuphtml); > map.addOverlay(marker); > gmarkers[i] = marker; > } > > } > > function createMarker(point, icon, popuphtml) { > var popuphtml = "<div id=\"popup\">" + popuphtml + "<\/div>"; > var marker = new GMarker(point, icon); > GEvent.addListener(marker, "click", function() { > marker.openInfoWindowHtml(popuphtml); > }); > return marker; > > } > > function zin (lat,lon) {map.setCenter(new GLatLng(lat,lon), map.zoomIn > ());} > function zot (lat,lon) {map.setCenter(new GLatLng(lat,lon), map.zoomOut > ());} > > function MM_preloadImages() { //v3.0 > var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); > var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; > i<a.length; i++) > if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a > [i];}}} > > <!--END OF CODE FOR CREATING GOOGLE MAPS...--> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
