jQuery Store Locator toont verkeerde afstand

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Senior Software Developer C++

Vacature details Vakgebied: Software/IT Opleiding: Senior Vacature ID: 13342 Introductie Do you want to work for one of the most innovative companies located in the region of Eindhoven. Currently Due to growth we are looking for a Senior Software Developer. Our client is a high-tech company with international roots and can provide you with a challenging opportunity. Functieomschrijving Responsibilities: Design, develop, and maintain high-quality software applications in C++ Collaborate with other engineers, product managers, and stakeholders to understand requirements and develop solutions Write clean, maintainable, and efficient code Conduct thorough testing and debugging to ensure high-quality software Optimize applications for

Bekijk vacature »

Back-end Developer (Permanent position with the em

Bedrijfsomschrijving Dutch specialist in technical installation materials. Functieomschrijving Purpose of the position: Our client is looking for a Back-end Developer who, together with the rest of the energetic and dynamic team, is responsible for the development and management of the website. This not only concerns the development and management of the current website, but also the development of a new Headless Commerce Platform to keep the customer's website Future proof. Within the IT department, there is a real DevOps culture and the commerce team is at the forefront and tries to implement continuous improvements. Most important tasks: ï‚· Designing and

Bekijk vacature »

Medior Java developer (fullstack)

Wat je gaat doen: Of beter nog, wat wil jij doen? Binnen DPA GEOS zijn we dan ook op zoek naar enthousiaste Java developers om ons development team te versterken. Als Java developer werk je in Agile/Scrum teams bij onze klanten en daarbij kun je eventueel ook andere ontwikkelaars begeleiden in het softwareontwikkelproces. Verder draag je positief bij aan de teamgeest binnen een projectteam en je kijkt verder dan je eigen rol. Je gaat software maken voor verschillende opdrachtgevers in jouw regio. Je bent een professional die het IT-vak serieus neemt en kwaliteit levert. Je leert snel vanwege je diepgaande

Bekijk vacature »

Senior .NET Developer I goed salaris en deels thui

Bedrijfsomschrijving Mijn opdrachtgever is al ruim 20 jaar een gevestigde naam in de wereld van software ontwikkeling, met drie kantoren in de Randstad, waaronder Alphen aan den Rijn. Zij richten zich op het bouwen van IT-oplossingen die ervoor zorgen dat de productiviteit van klanten te allen tijden optimaal is. Hiervoor neemt jouw nieuwe werkgever het volledige ontwikkelproces tot haar rekening; van het eerste gesprek om de klantwensen in kaart te brengen, tot aan het uiteindelijke onderhoud van de opgeleverde oplossing. In totaal werken er inmiddels bijna 200 gemotiveerde IT-ers binnen deze organisatie. De gemiddelde leeftijd ligt rond de 35. Het

Bekijk vacature »

C# Developer

Dit ga je doen Je gaat aan de slag in het websites team of portals team waarin je je bezighoudt met concept & design, implementatie en ook een stukje bugfixing en onderhoud; Je werkt met je team volgens de Scrum werkwijze; Zo adviseer je ook de PO & Scrum Master over de technische architectuur, koppelingen en integratie met externe systemen en API’s; Je blijft op de hoogte van de laatste ontwikkelingen en trends op het gebied van C# / .NET en deelt deze kennis binnen de organisatie. Hier ga je werken Onze klant is een internationale organisatie gevestigd in de

Bekijk vacature »

Medior/senior Front-end developer (Vue.js)

Functie Als Front-end developer ben je uiteindelijk overkoepelend aan de slag voor de 3 ontwikkelteams die ieder aan een specifiek product werken. In samenwerking met de UX-designer en de huidige Front-end developer zorg je voor gebruiksvriendelijke software. Lijkt het jou interessant om complexe problemen op te lossen en feautures naar een hoger niveau te tillen? En vind je het niet erg om oudere delen van de applicaties te refactoren i.c.m. het toevoegen van nieuwe functionaliteiten? Dan komen wij graag met je in contact. Eisen • HBO werk- en denkniveau (ze kijken niet naar papieren, maar naar denkniveau, motivatie en zelfredzaamheid)

Bekijk vacature »

Back-end Developer

Functieomschrijving Heb jij kort geleden je HBO ICT Informatica diploma in ontvangst mogen nemen? Of heb je een aantal jaar ervaring als Software Developer en ben je klaar voor een nieuw hoofdstuk in jouw carrière? Voor een gewaardeerde werkgever in de regio van Goirle zijn wij op zoek naar een junior/medior Back-end Developer met affiniteit met MS Acess. Samen met een vooruitstrevend team ben je verantwoordelijk voor het ontwikkelen van maatwerk software voor hun klanten. Je hebt kennis of ervaring van SQL en affiniteit met MS Acess. Je bent klantvriendelijk en flexibel ingesteld en vindt het leuk om klanten te

Bekijk vacature »

PHP Developer gezocht!

Functie omschrijving Wij zijn op zoek naar een PHP Developer! Ben jij op zoek naar een nieuwe uitdaging? Lees dan snel verder! Voor een organisatie in de regio Utrecht die zich bezighoud met het verbeteren van de medicatieveiligheid zoeken wij een Software Developer. In deze functie zijn wij op zoek naar een slimme en enthousiaste Developer die interesse heeft in farmacie, logistiek en ICT. Daarnaast beschik je over een goed analytisch vermogen en ben je van nature gestructureerd en resultaatgericht. Je moet in deze functie daadkrachtig, flexibel en communicatief goed zijn. Je verantwoordelijkheden bestaan uit: Object georiënteerd programmeren; Werken in

Bekijk vacature »

.NET developer

Functie Als .NET developer werk jij samen in een multidisciplinair ontwikkel team met 1-2 Senior .NET developers, twee front-end developers, Data Scientists en één UX designer. Als team werken jullie aan het ontwikkelen van een Cloud based applicatie en aan het stabieler maken van deze applicatie. Ook unit testing gaat erg belangrijk worden in jouw nieuwe functie. Samen met de Senior .NET ontwikkelaar wordt jij verantwoordelijk voor het ontwikkelen van de API. Jullie werken met veel data en incidenteel komen er ook data vraagstukken en zullen er wat queries gedraaid moeten worden. Dit betekend dat jij veel gaat werken met

Bekijk vacature »

Junior .NET developer

Functie Als junior .NET developer begint jouw dag na een bak koffie met een stand up. De vorderingen worden tijdens de stand up besproken en de doelen worden opgesteld waar jullie als team in de volgende sprint naartoe gaan werken. Onze backend is geschreven in .NET Core en onze Front-end in Angular. Bij ons ga jij dan ook Fullstack aan de slag. Jij wordt hier opgeleid om zelfstandig te kunnen programmeren en applicaties te kunnen implementeren. Er wordt op projectbasis gewerkt, dit bied leuke uitdagingen omdat elke klant een andere visie heeft over de applicatie die wij maken. Je gaat

Bekijk vacature »

Lead developer

Functie Als Lead developer wordt jij onderdeel van een multidisciplinair team van circa 23 software engineers. Als team werken jullie agile en zijn termen als Continuous Integration en Continuous Delivery dagelijkse koek. Jullie werken aan uitdagende en afwisselende projecten met als doel klanten een totaal oplossing aan te kunnen bieden. Jij wordt verantwoordelijk voor complete projecten waarbij jij als verantwoordelijke zorgt dat het project op de juiste manier blijft draaien. Zo haal jij ook de requirements op bij de klant en kijk jij samen met het team en met de salesafdeling hoeveel uren hiervoor nodig zijn. Daarnaast stuur jij jouw

Bekijk vacature »

Junior .NET developer

Functie Om half 9 kom jij binnen en pak jij als eerst natuurlijk een bakje koffie of thee. Vervolgens ga jij je voorbereiden op de stand-up van kwart voor 9. Zijn er bijvoorbeeld dingen waar jij nog tegen aan loopt? Of is er nog code die getest of gereviewd moet worden? Vervolgens starten jullie met de stand up en na de stand up zoeken jullie elkaar op en gaan jullie aan de slag. Als team met 6 developers werken jullie in drie wekelijkse sprints. Het einde van een sprint is altijd op een donderdag zodat jullie op vrijdag de demo

Bekijk vacature »

Front-end developer Supply Chain Angular, ReactJS,

Functie Het development team bestaat momenteel uit 9 fullstack (Python en .NET) developers. Binnen het team ga jij je toespitsen op het creëren van de optimale toegankelijkheid en user experience. Om dit voor elkaar te krijgen zul je ontwerpen, programmeren, testen en implementeren. Het hele proces dus! Maar ook bijvoorbeeld meedenken over strategie en design. Hierin krijg je veel vrijheid om de functie naar eigen inzicht in te vullen en te pionieren. Alle data die wordt gebruikt is zichtbaar in een webapplicatie, geschreven in Angular en React. Momenteel zijn ze bezig om de dashboards anders vorm te geven en de

Bekijk vacature »

Creatieve Front-end developer gezocht!

Functie Het front-end team bestaat momenteel uit 4 collega’s en is hard aan het groeien! Samen leveren jullie een essentiële bijdrage aan de applicaties die ze voor hun klanten realiseren. Je werkt in het front-end team samen met de back-end teams en product owners om te zorgen dat de applicaties een fijne gebruikerservaring opleveren. Jouw expertise zorgt ervoor dat de juiste keuzes gemaakt worden qua techniek en ontwerp, van back-end tot aan gebruiker. In samenspraak met je team bepalen jullie de beste keuze voor techniek. Ook is er altijd ruimte om nieuwe technieken te ontdekken. Eisen • Je hebt gedegen

Bekijk vacature »

Junior Outsystems developer

Functie Als junior Outsystems developer wordt jij onderdeel van een multidisciplinair team van 23 software engineers. Ons team werkt agile en termen als Continuous Integration en Continuous Delivery zijn bij ons dagelijkse koek. Wij werken aan uitdagende en afwisselende projecten met als doel onze klanten een totaal oplossing aan te bieden. Als junior Outsystems developer krijg jij bij ons de kans om jezelf te ontwikkelen naar een volwaardige ervaren en gecertificeerde Outsystems developer. Jij een team met ervaren mensen (10+ ervaring) om je heen. Zo heb jij niet het gevoel dat jij meteen in het diepe wordt gegooid en uiteraard

Bekijk vacature »
Lei Cremers

Lei Cremers

17/10/2015 18:39:50
Quote Anchor link
Hi all,

Ik heb onderstaande JS-code toegepast ten behoeve van een store locator.
De store locator geeft een overzicht van shops op basis van reisafstand vanaf locatie.
Zie hier de link naar de demo-page: http://optimax.apphb.com/demo.html

Mijn vraag heeft betrekking op de foutieve weergave van de afstand.

Als je 'London' invoert in het zoekveld dan wordt bij de eerste hit '11 miles' weergegeven, waar dit 1.1 mile zou moeten zijn.
Bij lange afstanden treedt deze fout ook op. Bij een afstand boven de 1000 miles wordt deze door Google-maps weergeven als bijvoorbeeld 1,161 miles terwijl JS 1.161 mile genereert, alsof de afstand dus minder dan 2 mile zou zijn.

Mogelijk verduidelijkt onderstaande mijn vraag:

Voorbeeld A
Daadwerkelijke afstand: 1,1 mile
Notificatie Google: 1.1 mile
JS genereert foutief: 11 miles

Voorbeeld B
Daadwerkelijke afstand: 1161 miles
Notificatie Google: 1,161 miles
JS genereert foutief: 1.161
Gevolg: deze shop wordt als eerste weergeven (alsof de afstand minder dan 2 mile is) in de resultaten, terwijl deze pas achteraan genoemd zou moeten worden.

Wie zou mij kunnen helpen met de aanpassing in waarschijnlijk JS?
Indien aanvullende informatie nodig is hoor ik het graag.

Thanks!

Hieronder de JS-code:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
(function ($) {
    $.fn.storeLocator = function (options) {

        var settings = $.extend({
            'mapDiv': 'map',
            'listDiv': 'list',
            'formID': 'user-location',
            'pinColor': 'fe7569',
            'startPinColor': '66bd4a',
            'pinTextColor': '000000',
            'storeLimit': 10,
            'distanceAlert': 60,
            'xmlLocation': 'data/stores.xml',
            'addressErrorMsg': 'Please enter valid UK address address or postcode',
            'googleDistanceMatrixDestinationLimit': 25,
            'defaultLat': 52.3038165,
            'defaultLng': -1.081117,
            'defaultLocationName': 'Northampton, United Kingdom'
        }, options);

        return this.each(function () {
            var $this = $(this);

            // global array of shop objects
            var _locationset = new Array();
            var geocoder;

            // Calculate distances from passed in origin to all locations in the [_locationset] array
            // using Google Maps Distance Matrix Service https://developers.google.com/maps/documentation/javascript/reference#DistanceMatrixService
            var GeoCodeCalc = {};
            GeoCodeCalc.CalcDistanceGoogle = function (origin, callback) {
                var destCoordArr = new Array();
                var subFunctionTokens = [];

                $.each(_locationset, function (ix, loc) {
                    destCoordArr.push(loc.LatLng);
                });

                for (var i = 0; i < destCoordArr.length; i = i + settings.googleDistanceMatrixDestinationLimit) { // Google Distance Matrix allows up to 25 destinations to be passed in
                    var tempArr = destCoordArr.slice(i, Math.min(i + settings.googleDistanceMatrixDestinationLimit));
                    subFunctionTokens.push(this.CallGoogleDistanceMatrix(i, origin, tempArr));
                }

                $.when.apply($, subFunctionTokens)
                      .then(function () {
                          callback(true);
                      });
            };

            GeoCodeCalc.CallGoogleDistanceMatrix = function (startIndex, origin, destinations) {
                var token = $.Deferred();
                var service = new google.maps.DistanceMatrixService();
                service.getDistanceMatrix(
                  {
                      origins: [origin],
                      destinations: destinations,
                      travelMode: google.maps.TravelMode.DRIVING,
                      unitSystem: google.maps.UnitSystem.METRIC
                  }, function (response, status) {
                      if (response && response.rows.length) {
                          var results = response.rows[0].elements;
                          $.each(results, function (j, val) {
                              if (results[j].status != "ZERO_RESULTS") {
                                  _locationset[startIndex + j].Distance = GoogleMapDistanceTextToNumber(results[j].distance.text);
                              }
                          });

                          token.resolve();
                      }
                  });

                return token.promise();
            };

            // Converts "123.45 mi" into 123.45
            function GoogleMapDistanceTextToNumber(str) {
                return Number(str.replace(/[^0-9.]/g, ""));
            }

            // removes Google Maps URL unfriendly chars from a string
            function formatGoogleMapUrlString(str) {
                return str.replace("&", "%26").replace(" ", "+");
            }

            //Geocode function for the origin location
            geocoder = new google.maps.Geocoder();
            function GoogleGeocode() {
                this.geocode = function (address, callbackFunction) {
                    geocoder.geocode({ 'address': address }, function (results, status) {
                        if (status == google.maps.GeocoderStatus.OK) {
                            var result = {};
                            result.latitude = results[0].geometry.location.lat();
                            result.longitude = results[0].geometry.location.lng();
                            result.formatted_address = results[0].formatted_address;
                            result.address_components = results[0].address_components;
                            callbackFunction(result);
                        } else {
                            handleError("Geocode was not successful for the following reason: " + status);
                            callbackFunction(null);
                        }
                    });
                };

                this.geocodeLatLng = function (LatLng, callbackFunction) {
                    geocoder.geocode({ 'location': LatLng }, function (results, status) {
                        if (status == google.maps.GeocoderStatus.OK && results.length) {
                            callbackFunction(results[0]);
                        } else {
                            handleError("Geocode was not successful for the following reason: " + status);
                            callbackFunction(null);
                        }
                    });
                };
            }

            //Process form input
            $(function () {
                $(document).on('submit', '#' + settings.formID, function (e) {
                    $("#lblError").html("");
                    //Stop the form submission
                    e.preventDefault();
                    //Get the user input and use it
                    var userinput = $('form').serialize();
                    userinput = userinput.replace("address=", "");
                    if (userinput == "") {
                        handleError(settings.addressErrorMsg);
                    }

                    var g = new GoogleGeocode();
                    var address = userinput;
                    g.geocode(address, function (data) {
                        if (data != null) {
                            showAddress(data);
                            mapping(data.latitude, data.longitude);
                        } else {
                            //Unable to geocode
                            handleError(settings.addressErrorMsg);
                        }
                    });

                    //Replace spaces in user input
                    userinput = formatGoogleMapUrlString(userinput);
                });
            });

            $(document).ready(function () {
                // Try HTML5 geolocation
                if (navigator.geolocation) {
                    navigator.geolocation.getCurrentPosition(function (position) {
                        //map.setCenter(pos);
                        var g = new GoogleGeocode();
                        var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);

                        g.geocodeLatLng(latlng, function (address) {
                            if (address) {
                                showAddress(address);
                            } else {
                                //Unable to geocode
                                handleNoGeolocation('Error: Unable to geocode address');
                            }
                        });

                        // do the mapping stuff
                        mapping(position.coords.latitude, position.coords.longitude);

                    }, function () {
                        handleNoGeolocation("Tracking of location was not allowed.");
                    });
                } else {
                    // Browser doesn't support Geolocation
                    handleNoGeolocation(false);
                }
            });

            function showAddress(address) {
                $("#lblAddress").html(address.formatted_address);
                // find a postcode and show it in the address textbox
                $.each(address.address_components, function (i, val) {
                    if (val.types[0] == "postal_code") {
                        $("#address").val(val.short_name);
                        return false; // breaks the each() loop
                    }
                });
            }

            function handleNoGeolocation(error) {
                if (error) {
                    var content = error;
                } else {
                    var content = 'Error: Your browser doesn\'t support geolocation.';
                }

                handleError(content + " Using default location.");
                mapping(settings.defaultLat, settings.defaultLng);
                $("#lblAddress").html(settings.defaultLocationName);

            }

            function handleError(error) {
                $("#lblError").html(error);
            }

            //Now all the mapping stuff
            function mapping(orig_lat, orig_lng) {
                $(function () {
                    //Parse xml with jQuery
                    $.ajax({
                        type: "GET",
                        url: settings.xmlLocation,
                        dataType: "xml",
                        success: function (xml) {
                            _locationset = new Array();
                            $(xml).find('Placemark').each(function (i) {
                                var shop = {
                                    Name: $(this).find('name').text(),
                                    //Take the lat lng from the user, geocoded above
                                    LatLng: new google.maps.LatLng(
                                        $(this).find('coordinates').text().split(",")[1],
                                        $(this).find('coordinates').text().split(",")[0]),
                                    Description: $(this).find('description').text(),
                                    Marker: null,
                                    Distance: null
                                };
                                _locationset.push(shop);
                            });

                            // Calc Distances from user's location
                            GeoCodeCalc.CalcDistanceGoogle(new google.maps.LatLng(orig_lat, orig_lng), function (success) {
                                if (!success) { //something went wrong
                                    handleError("Unable to calculate distances at this time");
                                }
                                else {
                                    //Sort the multi-dimensional array numerically
                                    _locationset.sort(function (a, b) {
                                        return ((a.Distance < b.Distance) ? -1 : ((a.Distance > b.Distance) ? 1 : 0));
                                    });

                                    // take "N" closest shops
                                    _locationset = _locationset.slice(0, settings.storeLimit);

                                    //Check the closest marker
                                    if (_locationset[0].Distance > settings.distanceAlert) {
                                        handleError("Unfortunately, our closest location is more than " + settings.distanceAlert + " miles away.");
                                    }

                                    //Create the map with jQuery
                                    $(function () {
                                        var orig_LatLng = new google.maps.LatLng(orig_lat, orig_lng);
                                        //Google maps settings
                                        var myOptions = {
                                            center: orig_LatLng,
                                            mapTypeId: google.maps.MapTypeId.ROADMAP
                                        };

                                        var map = new google.maps.Map(document.getElementById(settings.mapDiv), myOptions);
                                        //Create one infowindow to fill later
                                        var infowindow = new google.maps.InfoWindow();

                                        //Add user location marker
                                        var marker = createMarker(orig_LatLng, "0", settings.startPinColor);
                                        marker.setAnimation(google.maps.Animation.DROP);
                                        var bounds = new google.maps.LatLngBounds();
                                        bounds.extend(orig_LatLng);

                                        $("#" + settings.listDiv).empty();

                                        $(_locationset).each(function (i, location) {
                                            bounds.extend(location.LatLng);
                                            letter = String.fromCharCode("A".charCodeAt(0) + i);
                                            location.Marker = createMarker(location.LatLng, letter, settings.pinColor);
                                            create_infowindow(location);
                                            listClick(letter, location);
                                        });

                                        // zoom in/out to show all markers
                                        map.fitBounds(bounds);

                                        function listClick(letter, shop) {
                                            $('<li />').html("<div class=\"list-details\"><div class=\"list-content\">"
                                            + "<div class=\"list-label\">" + letter + "<\/div>"
                                            + "<div class=\"loc-name\">" + shop.Name + "<\/div> <div class=\"loc-addr\">" + shop.Description + "<\/div>"
                                            + (shop.Distance ? "<div class=\"loc-addr2\"><i>approx. " + shop.Distance + " miles</i><\/div>" : "")
                                            + "<div class=\"loc-web\"><a href=\"http://maps.google.co.uk/maps?saddr="
                                            + formatGoogleMapUrlString($("#address").val()) + "+%40" + orig_lat + "," + orig_lng
                                            + "&daddr=" + formatGoogleMapUrlString(shop.Name) + "+%40" + shop.LatLng.lat() + "," + shop.LatLng.lng()
                                            + "&hl=en" + "\" target=\"_blank\">&gt;Get directions</a><\/div><\/div><\/div>")
                                            .click(function () {
                                                create_infowindow(shop, "left");
                                            }).appendTo("#" + settings.listDiv);
                                        };

                                        //Custom marker function - aplhabetical
                                        function createMarker(point, letter, pinColor) {
                                            //Set up pin icon with the Google Charts API for all of our markers
                                            var pinImage = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=" + letter + "|" + pinColor + "|" + settings.pinTextColor,
                                              new google.maps.Size(21, 34),
                                              new google.maps.Point(0, 0),
                                              new google.maps.Point(10, 34));
                                            var pinShadow = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_shadow",
                                              new google.maps.Size(40, 37),
                                              new google.maps.Point(0, 0),
                                              new google.maps.Point(12, 35));

                                            //Create the markers
                                            return new google.maps.Marker({
                                                position: point,
                                                map: map,
                                                icon: pinImage,
                                                shadow: pinShadow,
                                                draggable: false
                                            });
                                        };

                                        //Infowindows
                                        function create_infowindow(shop, listLocation) {
                                            var formattedAddress = "<div class=\"infoWindow\"><b>" + shop.Name + "<\/b>"
                                            + "<div>" + shop.Description + "<\/div>"
                                            + (shop.Distance ? "<div><i>" + shop.Distance + " miles<\/i><\/div><\/div>" : "<\/div>");

                                            //Opens the infowindow when list item is clicked
                                            if (listLocation == "left") {
                                                infowindow.setContent(formattedAddress);
                                                infowindow.open(shop.Marker.get(settings.mapDiv), shop.Marker);
                                            }
                                            //Opens the infowindow when the marker is clicked
                                            else {
                                                google.maps.event.addListener(shop.Marker, 'click', function () {
                                                    infowindow.setContent(formattedAddress);
                                                    infowindow.open(shop.Marker.get(settings.mapDiv), shop.Marker);
                                                })
                                            }
                                        };
                                    });
                                }
                            });
                        }
                    });
                });
            }

        });
    };
})(jQuery);
[/CODE]
 
Er zijn nog geen reacties op dit bericht.



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.