OOhhhhhhhh. So by declaring the icon before the function it defines
just WHAT the icon is, not where it functions? I should have picked
that up when you said declaring "outside". I am still learning so I
didn't know that placing it inside the function populateMap would
break it. Now I can see how the icon is a declaration, not a function.
I didn't know the difference. I was starting at function populateMap
not <script type="text/javascript">. I have so much to learn. Sorry
for being a beginner and thank you for the help and the article. Looks
like I need Javascript For Dummies.

On Jul 13, 12:57 pm, "[email protected]" <[email protected]>
wrote:
> On Jul 13, 10:14 am, DVL Developer <[email protected]> wrote:
>
> > Hiya,
>
> > I am shooting in the dark here
>
> That rarely works.
>
> > and I am assuming by global you mean
> > this way:
>
> No.  See this page of Mike Williams' (v2) Tutorial:
> Javascript Concepts - Part 1 Scopehttp://econym.org.uk/gmap/scope.htm
>
> You need to move the declaration of "icon" outside of any function.
>
>
>
>
>
> >                 for(var i=1; i < points.length; i++) {
> >                         var point = new GLatLng(points[i][0],points[i][1]);
> >                         var windowInfo = points[i][2];
> >                         var marker = new GMarker(point, {icon: icon });
> >                         map.addOverlay(marker);
> >                 }
> >         }
>
> >         function createMarker(point, overlayText) {
> >                 var marker = new GMarker(point);
> >                 GEvent.addListener(marker, "click", function()
> > {marker.openInfoWindowHtml(overlayText);});
> >                 return marker;
> >         }
>
> > Yes, I am experimenting with the icons. The client wants to see many
> > options.
>
> > If I take icon out of the var marker I still don't see the bubble. If
> > I take that line out nothing shows. I am not sure where you are
> > advising me to move it.
>
> Here is the local copy I was playing with that works.  Compare it to
> yours (I changed the key so it would work in my 
> domain):http://www.geocodezip.com/psysolutions_com_indexCOPYc.html
>
>
>
> > I was in an Apache channel about a week ago and asked a question and
> > told them I was not a server admin and they told me to find another
> > job and give mine up. We all have to start somewhere and I am trying
> > to learn so I hope you will be patient.
>
> This group is (at least for the most part) pretty patient as long as
> you try and are interested in learning (and follow the posting
> guidelines and don't expect us to write your code for you).
>
>   -- Larry
>
>
>
> > On Jul 13, 11:58 am, "[email protected]" <[email protected]>
> > wrote:
>
> > > On Jul 13, 9:51 am, "[email protected]" <[email protected]>
> > > wrote:
>
> > > > On Jul 13, 8:51 am, DVL Developer <[email protected]> wrote:
>
> > > > > I see the icons appearing but the bubbles don't work now after I click
> > > > > on an icon.
>
> > > > >http://www.psysolutions.com/locations/indexCOPY/
>
> > > > You have defined a createMarker function, but you don't use it in your
> > > > code:
> > > >                 for(var i=1; i < points.length; i++) {
> > > >                         var point = new 
> > > > GLatLng(points[i][0],points[i][1]);
> > > >                         var windowInfo = points[i][2];
> > > >                         var marker = new GMarker(point, {icon: icon });
> > > >                         map.addOverlay(marker);
> > > >                 }
> > > >         }
>
> > > >         function createMarker(point, overlayText) {
>
> > > > The createMarker function adds the "click" listener for the marker...
>
> > > Also to make it work you will either have to move your definition of
> > > the icon into the global scope or into the createMarker function (it
> > > would be more efficient if you define it once in the global scope
> > > rather than every time the createMarker function runs.
>
> > > FYI - every time I load my local version of the page your "icon"
> > > changes.  I hope that is you experimenting with different icons.
>
> > >    -- Larry
>
> > > > > I am testing on a duplicate page until I get this working.
>
> > > > > Thank you for your help, this is really new ground for me. I really
> > > > > appreciate you.
>
> > > > > On Jul 13, 9:01 am, "[email protected]" <[email protected]>
> > > > > wrote:
>
> > > > > > On Jul 13, 5:41 am, DVL Developer <[email protected]> wrote:
>
> > > > > > > The current working map link is
>
> > > > > >http://www.psysolutions.com/locations
>
> > > > > > > Here is the current code. We are using a CMS called 
> > > > > > > ExpressionEngine:
>
> > > > > > > for(var i=1; i < points.length; i++) {
> > > > > > > var point = new GLatLng(points[i][0],points[i][1]);
> > > > > > > var windowInfo = points[i][2];
> > > > > > > var marker = createMarker(point,windowInfo);
> > > > > > > map.addOverlay(marker);
>
> > > > > > > }
> > > > > > > }
>
> > > > > > > function createMarker(point, overlayText) {
> > > > > > > var marker = new GMarker(point);
>
> > > > > > To change the icon of the marker, define the icon and change the 
> > > > > > line
> > > > > > above to use it:
> > > > > > var marker = new GMarker(point, {icon: myIcon });
>
> > > > > > If you want to change all the markers, that should be all you need 
> > > > > > to
> > > > > > do.  If you need to use multiple different markers then you need to
> > > > > > add code to select the correct icon in the createMarker function.
>
> > > > > >   -- Larry
>
> > > > > > > The client doesn't like the default red markers and they want them
> > > > > > > changes. We have made 2 new images. I went 
> > > > > > > tohttp://www.powerhut.co.uk/googlemaps/custom_markers.phpandgenerated
> > > > > > > some basic code.
>
> > > > > > > var myIcon = new GIcon();
> > > > > > > myIcon.image = 'markers/image.png';
> > > > > > > myIcon.printImage = 'markers/printImage.gif';
> > > > > > > myIcon.mozPrintImage = 'markers/mozPrintImage.gif';
> > > > > > > myIcon.iconSize = new GSize(32,32);
> > > > > > > myIcon.shadow = 'markers/shadow.png';
> > > > > > > myIcon.transparent = 'markers/transparent.png';
> > > > > > > myIcon.shadowSize = new GSize(48,32);
> > > > > > > myIcon.printShadow = 'markers/printShadow.gif';
> > > > > > > myIcon.iconAnchor = new GPoint(16,32);
> > > > > > > myIcon.infoWindowAnchor = new GPoint(16,0);
> > > > > > > myIcon.imageMap =
> > > > > > > [18,1,19,2,19,3,20,4,20,5,21,6,22,7,23,8,23,9,23,10,23,11,23,12,23,13,23,14­­­­,23,15,23,16,23,17,22,18,21,19,20,20,20,21,20,22,20,23,20,24,20,25,20,26­,­2­0­,27,20,28,20,29,19,30,14,30,13,29,12,28,12,27,12,26,12,25,12,24,12,23­,1­2,­22­,12,21,12,20,11,19,10,18,9,17,9,16,9,15,9,14,9,13,9,12,9,11,9,10,9­,9,­10,­8,1­1,7,12,6,13,5,13,4,13,3,14,2,15,1];
>
> > > > > > > How do I implement this code into what I already have here?
>
> > > > > > > I uploaded the images into the images folder so I know I would 
> > > > > > > add '/
> > > > > > > images/markers/image.png'; as the path (unless I am told 
> > > > > > > differently).
> > > > > > > This is my first map modification so any help is greatly 
> > > > > > > appreciated.- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -

-- 
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.

Reply via email to