Hi Chris,

js code prior to calling the setMarkers(), see if there's anything
amiss here, Chris. Thks.

                // GoogleMap code starts from here
                var map;
                var geocoder = null;
                var jobHasAppointments = { Yes: 1, No: 0 };

                // array to store geopoints for drawing a polyline
                var points = [];

                function pageLoad() {
                    if ($get('<%=hdnUseGoogleMap.ClientID
%>').value.toUpperCase() == "YES") {
                        initialize(HtmlDecode($get('<
%=hdnJobsWithApts.ClientID%>').value), HtmlDecode($get('<
%=hdnJobsWithAptsDetails.ClientID%>').value), HtmlDecode($get('<
%=hdnJobsWithNoApts.ClientID%>').value), HtmlDecode($get('<
%=hdnJobsWithNoAptsDetails.ClientID%>').value), HtmlDecode($get('<
%=hdnDefaultAddress.ClientID%>').value), HtmlDecode($get('<
%=hdnAppointmentView.ClientID%>').value));
 
document.getElementById("map_canvas").style.display =
(document.getElementById('<%=hdnShowMap.ClientID%>').value != "1") ?
'none' : 'block';
 
document.getElementById("spnPrintAppointments").style.display =
(document.getElementById('<%=hdnShowMap.ClientID%>').value != "1") ?
'none' : 'block';
                    }
                    else {
 
document.getElementById("map_canvas").style.display =
(document.getElementById('<%=hdnUseGoogleMap.ClientID
%>').value.toUpperCase() != "NO") ? 'none' : 'block';
 
document.getElementById("spnPrintAppointments").style.display =
(document.getElementById('<%=hdnShowMap.ClientID%>').value != "1") ?
'none' : 'block';
                    }
                }

                function initialize(jobsWithApts, jobsWithAptsDetails,
jobsWithNoApts, jobsWithNoAptsDetails, defaultAddress,
appointmentView) {
                    if (appointmentView.toLowerCase() == "dayview") {
                        points = [];
                        geocoder = new google.maps.Geocoder();
                        var mapOptions = {
                            zoom: 10,
                            mapTypeId: google.maps.MapTypeId.ROADMAP
                        }
                        map = new
google.maps.Map(document.getElementById("map_canvas"), mapOptions);
                        if ((jobsWithApts == '' && jobsWithNoApts ==
'')) {
                            var defaultMarkerImage = '<%=
ResolveUrl("~/Images/pink-dot.png") %>';
                            geocoder.geocode({ 'address':
defaultAddress }, function(results, status) {
                                if (status ==
google.maps.GeocoderStatus.OK) {
 
map.setCenter(results[0].geometry.location);
                                    var marker = new
google.maps.Marker({
                                        icon: defaultMarkerImage,
                                        map: map,
                                        position:
results[0].geometry.location
                                    });
                                }
                            });
                        }
                        else {
                            if (jobsWithApts != '') {setMarkers(map,
jobsWithApts, jobHasAppointments.Yes); }
                            setTimeout(function()
{ drawPolyline(map) }, 1000);
                            if (jobsWithNoApts != '') setMarkers(map,
jobsWithNoApts, jobHasAppointments.No);
                        }
                    }
                }

On Sep 30, 5:21 pm, shotemba <[email protected]> wrote:
> Hi Chris,
>
> I've put int the parens like so :
> var infowindow = new google.maps.InfoWindow();
> but getting no where.
>
> HTML code wise, decided not to include as it would just bloat the
> page. v2 of the api was working fine it's when I migrated the code to
> v3, things went pear-shaped. I'm willing to provide you with a login
> account to our dev site if you could pass me email account.
>
> Thks, Chris.
>
> On Sep 30, 4:59 pm, Chris Broadfoot <[email protected]> wrote:
>
>
>
> > Sorry but we still don't have the full code. There is no HTML in your first
> > email at all.
>
> > Unfortunately I still get a login page at your link.
>
> > One thing I noticed is you omitted the parens after new
> > google.maps.InfoWindow()...
>
> > Chris
>
> > On Thu, Sep 30, 2010 at 6:39 PM, shotemba <[email protected]> wrote:
> > > Hi there,
>
> > > Here is the code in full, sorry about the earlier post, yeap the site
> > > is passport protected, will email an attachment shortly.
>
> > >                function setMarkers(map, appointments,
> > > jobHasAppointment)
> > >                {
> > >                    var jobAppointments = appointments.split('|');
> > >                    var j = 1;
> > >                    var pushPinURL = $get('<%=hdnPushPinURL.ClientID
> > > %>').value;
>
> > >                    for (var i = 0; i < jobAppointments.length; i++) {
>
> > >                        var riskAddress = jobAppointments[i].split('^')
> > > [0];
> > >                        var comments = (jobAppointments[i].split('$')
> > > [1].indexOf('`')) ? jobAppointments[i].split('$')[1].split('`')[0] :
> > > '';
>
> > >                         geocoder.geocode({ 'address': riskAddress },
> > > function(results, status) {
> > >                            if (status ==
> > > google.maps.GeocoderStatus.OK) {
>
> > > map.setCenter(results[0].geometry.location);
>
> > >                                if (jobHasAppointment ==
> > > jobHasAppointments.Yes) {
> > >                                    var appointmentMarkerImage = new
> > > google.maps.MarkerImage(pushPinURL + j++ + ".png")
> > >                                    var marker = new
> > > google.maps.Marker({
> > >                                        icon: appointmentMarkerImage,
> > >                                        map: map,
> > >                                        title: 'job#: ' + jobID,
> > >                                        position:
> > > results[0].geometry.location
> > >                                    });
>
> > > points.push(results[0].geometry.location);
> > >                                }
> > >                                else {
> > >                                    var marker = new
> > > google.maps.Marker({
> > >                                        map: map,
> > >                                        title: 'job#: ' + jobID,
> > >                                        position:
> > > results[0].geometry.location
> > >                                    });
> > >                                }
>
> > >                                (function(jobID, comments,marker) {
>
> > > google.maps.event.addListener(marker, 'click', function() {
> > >                                        var infowindow = new
> > > google.maps.InfoWindow;
> > >                                        var content = '<div
> > > class="infowindow">'+comments+'</div>';
>
> > > infowindow.setContent(content);
> > >                                         infowindow.open(map, this);
> > >                                    });
> > >                                })(jobID, comments, marker);
>
> > >                            } else {
> > >                                alert("Geocode was not successful for
> > > the following reason: " + status);
> > >                            }
> > >                        });
> > >                    }
> > >                }
>
> > > On Sep 30, 4:30 pm, Rossko <[email protected]> wrote:
> > > > > Pls igore the earlier post, here is the full code.
>
> > > > But as you can see, it is unreadably mangled.
>
> > > > > google.maps.event.addListener(marker,
> > > > > infowindow.setContent(content);
> > > > > infowindow.open(map,
>
> > > > Your webpage isn't accessible, password required.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Google Maps JavaScript API v3" group.
> > > To post to this group, send email to
> > > [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<google-maps-js-api-v3%2b­­[email protected]>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-maps-js-api-v3?hl=en.-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 JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to