You can probably just do
var marker = new GMarker(point, {icon: icon});
if that doesnt help, then will probably need to see that link.
2008/12/28 Dan <[email protected]>:
>
> Hopefully this is easy enough you won't need a link to the map itself.
> I'm trying to use mapiconmaker to generate a flat icon that I'll later
> label with variable data. For now, I can't figure out where to plug in
> the code from the wizard. Everything I've tried either gets me the
> default icon or nothing at all:
>
> Any help appreciated.
>
> Thanks
>
> <code>
>
> <script src="mapiconmaker.js" type="text/javascript"></script>
>
> <script type="text/javascript">
> //<![CDATA[
>
> var iconOptions = {};
> iconOptions.width = 32;
> iconOptions.height = 32;
> iconOptions.primaryColor = "#FF0000";
> iconOptions.label = "a";
> iconOptions.labelSize = 0;
> iconOptions.labelColor = "#000000";
> iconOptions.shape = "circle";
> var icon = MapIconMaker.createFlatIcon(iconOptions);
>
>
> function load() {
> if (GBrowserIsCompatible()) {
> var map = new GMap2(document.getElementById("map"));
> map.addControl(new GSmallMapControl());
> map.addControl(new GMapTypeControl());
> map.setCenter(new GLatLng(38.23,-85.63), 10);
>
> GDownloadUrl("mapxml.php", function(data) {
> var xml = GXml.parse(data);
> var markers = xml.documentElement.getElementsByTagName
> ("marker");
> for (var i = 0; i < markers.length; i++) {
> var name = markers[i].getAttribute("Regular");
> var address = markers[i].getAttribute("Address");
> var station = markers[i].getAttribute("Station");
> var point = new GLatLng(parseFloat(markers[i].getAttribute
> ("lat")),
> parseFloat(markers[i].getAttribute
> ("lng")));
> var marker = createMarker(point, name, address, station);
> map.addOverlay(marker);
> }
> });
> }
> }
>
> function createMarker(point, name, address, type) {
> var marker = new GMarker(point);
> var html = "<b>$" + name + "<sup>9</sup>" + "</b> <br/>" +
> address + "<br/>" + type;
> GEvent.addListener(marker, 'click', function() {
> marker.openInfoWindowHtml(html);
> });
> return marker;
> }
>
>
> </script>
>
> </code>
>
> >
>
--
Barry
- www.nearby.org.uk - www.geograph.org.uk -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---