Note that there are some explanatory texts on larger screens.

plurals
  1. POsetInterval javascript does not seem to respond well
    primarykey
    data
    text
    <p>small summary. Since geocoding doesn't allow a lot of simultaneous requests and I have to display more then 11 markers on my googlemap I figured I would use some sort of interval to bypass the simultaneous request limit.<br> I figured here I would use the setInterval function from javascript. </p> <p>This is my code </p> <pre><code> function timeHackGeocode(location, name, contract, vestigingID) { setInterval(codeAddress(location, name, contract, vestigingID), 1000); } function collectingData() { @foreach (var item in Model) { @:timeHackGeocode("@item.StraatVestiging" + " " + "@item.nr" + "," + "@item.location","@item.name","@item.Contract", "@item.id"); } } function codeAddress(location, name, contract, vestigingID) { var address = location; var image; var zoomlevel; geocoder.geocode({ 'address': address }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var infoboxPos = results[0].geometry.location; var image = new google.maps.MarkerImage(returnImage(contract), // This marker is 20 pixels wide by 32 pixels tall. new google.maps.Size(30, 42), // The origin for this image is 0,0. new google.maps.Point(40,45), // The anchor for this image is the base of the flagpole at 0,32. new google.maps.Point(0, 32)); var marker = createMarkers(results[0].geometry.location, contract) google.maps.event.addListener(marker, 'mouseover', function() { infobox.open(map, marker); infobox.setOptions(infoboxOptions(boxText(name, contract, vestigingID), infoboxPos)); }); } else { // alert("Geocode was not successful for the following reason: " + status); } }); } </code></pre> <p>Unfortunately this does not seem to work and I tried all kinds of different setups. <a href="https://developer.mozilla.org/en/DOM/window.setInterval" rel="nofollow">https://developer.mozilla.org/en/DOM/window.setInterval</a></p> <p>Does anyone have an idea what is going on? </p> <p>ps. I will change this hack in the future by already having the latitude and longitude but for now I wish to get this to work. </p> <p>Suggestions much appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload