﻿$addHandler(window, 'load', load_myMap); var myMap; var myMapResponse; var myLegenda; var gdir; var routeLatLng = []; var mgr; var ao; var icons; var colors; var newWindow; var routeBarOpen = false; var routeResultOpen = false; var routeObject; var myBounds; var max; var warningShown = false; var redraws = 0; var markersArray = []; var cluster; function myGUnload() { try { GUnload() } catch (ex) { } } function load_myMap() { if (GBrowserIsCompatible()) { SetMarkers() } } function getFieldValue(a) { var b; var c = new RegExp(a + "=([^&]+)", "gi"); if (c.test(location.search)) { b = unescape(RegExp.$1) } else { b = "" } return b } function onGetStart(a) { max = max * -1; onGetObjects(a); GEvent.addListener(myMap, "moveend", redraw); redraw() } function redraw() { if (myMap.getZoom() < max) { cluster.removeMarkers(); myMap.clearOverlays(); myBounds = null; if (!warningShown) { warningShown = true; myMap.openInfoWindowHtml(myMap.getCenter(), "<p style='margin-right: 10px;' class='divBallon'>Om objecten te bekijken, dient u in te zoomen op een gebied. Pas vanaf een bepaald zoomniveau, verschijnen de objecten op de kaart. Het kan enkele seconden duren voordat de objecten in een gebied zijn geladen.</p>", { maxWidth: 280 }) } } else { if (!myBounds || !myBounds.containsBounds(myMap.getBounds())) { warningShown = false; var a = myMap.getBounds().getSouthWest(); a = new GLatLng(a.lat() - 0.05, a.lng() - 0.05); var b = myMap.getBounds().getNorthEast(); b = new GLatLng(b.lat() + 0.05, b.lng() + 0.05); myBounds = new GLatLngBounds(a, b); MyMapService.GetBoundObjects(myMapResponse.GuidVerzameling, myMapResponse.GuidObject, a.lat(), a.lng(), b.lat(), b.lng(), onRedraw) } else { redrawLegenda() } } } function redrawLegenda() { Array.forEach(myMapResponse.Collections, function (b) { var c = $get("check" + b.Id); if (b.Objects && c && !c.checked) { Array.forEach(b.Objects, function (a) { try { a.Marker.hide() } catch (ex) { } }) } }) } function onRedraw(b) { if (b) { cluster.removeMarkers(); myMap.clearOverlays(); myMapResponse.Objects = b.Objects; myMapResponse.Collections = b.Collections; markersArray = []; Array.forEach(myMapResponse.Collections, function (a) { if (a.Objects.length > 0) { createMarkers(a.Objects) } }); createMarkers(myMapResponse.Objects); cluster.addMarkers(markersArray); cluster.refresh(false); redrawLegenda(); if (redraws++ < 1) { ShowSelected() } } } function onGetObjects(c) { $addHandler(window, 'unload', myGUnload); myMap = new GMap2($get("MapDiv")); myMap.addMapType(G_NORMAL_MAP); myMap.addMapType(G_SATELLITE_MAP); myMap.addMapType(G_HYBRID_MAP); gdir = new GDirections(myMap, $get("divRouteResult2")); GEvent.addListener(gdir, "error", handleErrors); GEvent.addListener(gdir, "load", onGDirectionsLoad); myMap.enableDoubleClickZoom(); myMap.enableContinuousZoom(); var d = new GKeyboardHandler(myMap); GEvent.addListener(myMap, "zoomend", function (a) { Control.ZoomEnd(a) }); if (getFieldValue("route") == "-1" || getFieldValue("route") == "-2") { $get("KaartTypeDiv").style.display = "none"; $get("ControlDiv").style.display = "none"; myMap.addControl(new GSmallZoomControl3D()) } else { myMap.addControl(new MyMapTypeControl()); myMap.addControl(new GScaleControl()) } myMapResponse = c; var e = myMapResponse.MapType; var f = getFieldValue("MapType"); if (f == "0") e = 0; if (f == "-1") e = -1; if (f == "1") e = 1; var g = G_NORMAL_MAP; if (e == -1) { g = G_SATELLITE_MAP; $get("TabSATELLITE").style.fontWeight = "bold"; Control.MarkerMarge = 14; Control.Areal = true; $get('ControlDiv').className = 'ControlAreal'; $get('ControlDiv').style.height = 204 } else if (e == 1) { g = G_HYBRID_MAP; $get("TabHYBRID").style.fontWeight = "bold"; Control.MarkerMarge = 14; Control.Areal = true; $get('ControlDiv').className = 'ControlAreal'; $get('ControlDiv').style.height = 204 } else { $get("TabNORMAL").style.fontWeight = "bold"; Control.MarkerMarge = 0; Control.Areal = false; $get('ControlDiv').className = 'Control' } myMap.addControl(new MyZoomControl()); var h = getFieldValue("zoom"); if (!h) { h = myMapResponse.Zoom } else { h = parseInt(h) } icons = new Object(); Array.forEach(myMapResponse.Icons, function (a) { var b = new GIcon(); b.image = a.Url; b.iconAnchor = new GPoint(a.Width / 2, a.Height); b.infoWindowAnchor = new GPoint(a.Width / 2, 1); b.iconSize = new GSize(a.Width, a.Height); if (a.Shadow) { b.shadow = a.Shadow.Url; b.shadowSize = new GSize(a.Shadow.Width, a.Shadow.Height) } icons["Id" + a.Id] = b; if (a.Selected) { b.SelectedIcon = new GIcon(); b = b.SelectedIcon; b.image = a.Selected.Url; b.iconAnchor = new GPoint(a.Selected.Width / 2, a.Selected.Height); b.infoWindowAnchor = new GPoint(a.Selected.Width / 2, 1); b.iconSize = new GSize(a.Selected.Width, a.Selected.Height) } }); myMapResponse.Icons = null; colors = new Object(); Array.forEach(myMapResponse.Colors, function (a) { a.L = "#" + a.L; a.F = "#" + a.F; colors["Id" + a.Id] = a }); myMapResponse.Colors = null; createMarkers(myMapResponse.Objects); var i = ""; var j = getFieldValue("solo"); if (j == "2") { i = "<input id='checkSolo' type='checkbox' onclick='ToggleCollection(-1, \"checkSolo\")' "; i = i + "/> <label for='checkSolo'>Toon alle objecten</label><br />" } Array.forEach(myMapResponse.Collections, function (a) { if (!a.Objects || a.Objects.length > 0) { var b = "check" + a.Id; i = i + "<input id='" + b + "' type='checkbox' onclick='ToggleCollection(" + a.Id + ", \"" + b + "\" )' "; if (myLegenda) { i = i + "checked='checked' " } i = i + "/> <label for='" + b + "'>" + a.Text + "</label><br />"; if (a.Objects) { createMarkers(a.Objects) } } }); var k = { markers: markersArray, clusterMarkerTitle: c.ClusterText }; if (c.ClusterIconId > -1) { k.clusterMarkerIcon = icons["Id" + c.ClusterIconId] } cluster = new ClusterMarker(myMap, k); cluster.clusteringEnabled = c.ClusterIconId > -1; if (i.length > 0) { $get("LegendaSpan").innerHTML = i; $get("LegendaSpan").style.display = "inline"; myMap.addControl(new MyLegendaControl()); if (j == "2") { Array.forEach(myMapResponse.Objects, function (a) { if (!a.Selected) { a.Marker.hide() } }) } GEvent.addListener(myMap, "moveend", function () { redrawLegenda() }) } myMap.setCenter(new GLatLng(myMapResponse.Lat, myMapResponse.Lng), h, g); cluster.fitMapMaxZoom = h; Control.SetSliderZoomlevel(myMap.getZoom()); $get("MapDiv").lastChild.target = "_blank"; ShowSelected(); if (getFieldValue("lat") != "") { var l = []; l.push(getFieldValue("lat") + ", " + getFieldValue("lng")); l.push(ao.Lat + ", " + ao.Lng); gdir.loadFromWaypoints(l, { "locale": $get("hiddenLocale").value, "preserveViewport": "false" }) } else { $get("TextRoute").value = readCookie("address") } } function ShowSelected() { if (getFieldValue("route") != "-2") { Array.forEach(myMapResponse.Objects, function (a) { if (a.Selected) { ao = a; try { openMyInfoWindowHtml(a) } catch (ex) { } if (myMapResponse.Route && !myMapResponse.PoweredBy && getFieldValue("route") != "0" && getFieldValue("route") != "-1") { ShowRoute(false) } } }) } } function myZOrder(a, b) { if (a.IsSelected) return 10; return 1 } function createMarkers(j) { Array.forEach(j, function (b) { b.Selected = b.Guid == myMapResponse.GuidObject; var c = String.format(myMapResponse.TooltipFormatString, b.Title, b.Adres1, b.Adres2, b.Text); var a = b.Position.split('@'); var d = a[0]; if (d == 'POINT') { var e = icons["Id" + b.IconId]; if (b.Selected && e.SelectedIcon) { e = e.SelectedIcon } a = a[1].split(' '); a = new GLatLng(parseFloat(a[1]), parseFloat(a[0])); var f = new GMarker(a, { clickable: true, icon: e, title: c, zIndexProcess: myZOrder }); f.IsSelected = b.Selected; markersArray.push(f); GEvent.addListener(f, "click", function () { openMyInfoWindowHtml(b) }); b.Marker = f; b.IsMarker = true; b.Lat = a.lat(); b.Lng = a.lng() } else { var g = colors["Id" + b.IconId]; a = CreatePositions(a[1]); if (d == 'LINES') { var h = new GPolyline(a, g.L, g.W, g.LO / 100, { clickable: true }); h.IsSelected = b.Selected; myMap.addOverlay(h); GEvent.addListener(h, "click", function (a) { b.Lat = a.lat(); b.Lng = a.lng(); openMyInfoWindowHtml(b, a) }); GEvent.addListener(h, "mouseover", function () { myMap.getDragObject().setDraggableCursor("pointer") }); GEvent.addListener(h, "mouseout", function () { myMap.getDragObject().setDraggableCursor("default") }); b.Marker = h } else { var i = new GPolygon(a, g.L, g.W, g.LO / 100, g.F, g.FO / 100, { clickable: true }); i.IsSelected = b.Selected; myMap.addOverlay(i); GEvent.addListener(i, "click", function (a) { b.Lat = a.lat(); b.Lng = a.lng(); openMyInfoWindowHtml(b, a) }); GEvent.addListener(i, "mouseover", function () { myMap.getDragObject().setDraggableCursor("pointer") }); GEvent.addListener(i, "mouseout", function () { myMap.getDragObject().setDraggableCursor("default") }); b.Marker = i } } }) } function CreatePositions(b) { var a = b.split(' '); var c = new Array(); for (var i = 0; i < a.length; i += 3) { c.push(new GLatLng(parseFloat(a[i + 1]), parseFloat(a[i]))) } return c } function openMyInfoWindowHtml(a, b) { if (getFieldValue("route") != "-2") { ao = a; var c = GetInfoWindowHtml(a).toString(); try { if (!a.IsMarker) { if (b == undefined) { b = new GLatLng(myMapResponse.Lat, myMapResponse.Lng) } myMap.openInfoWindowHtml(b, c, { maxWidth: myMapResponse.BalloonWidth }) } else { a.Marker.openInfoWindowHtml(c, { maxWidth: myMapResponse.BalloonWidth }) } } catch (ex) { myMap.setZoom(17); a.Marker.openInfoWindowHtml(c, { maxWidth: myMapResponse.BalloonWidth }) } if (!IsRoutePlanned()) { ClearHtmlInfo(); AddHtmlInfo(a, c) } } } function ClearHtmlInfo() { var a = $get("objectHtml"); if (a) { for (var i = a.rows.length; i > 0; i--) { a.deleteRow(i - 1) } } } function AddHtmlInfo(a, b) { var c = $get("objectHtml"); var d = c.insertRow(c.rows.length); var e = d.insertCell(0); if (a.IsMarker) { e.innerHTML = "<img src='" + a.Marker.getIcon().image + "' />" } else { e.innerHTML = "&nbsp;" } var f = d.insertCell(1); f.innerHTML = "<div class='objectHtml'>" + b + "</span>" } function GetInfoWindowHtml(a) { var b = new Sys.StringBuilder(); if (a.Image) { b.append("<table><tr valign=top><td>"); if (a.Link1 && myMapResponse.Link1) { b.append(String.format("<div class=\"Foto\"><a href=\"javascript:\" onclick=\"NavigateTo('{0}', {2}); return false;\"><img src=\"{1}\" alt=\"{3}\" /></a></div>", a.Link1, a.Image, newWindow, myMapResponse.Link1)) } else { b.append(String.format("<div class=\"Foto\"><img src=\"{0}\" /></div>", a.Image)) } b.append("</td><td>") } b.append("<div class=\"Titel\">"); b.append(escapeHTML(a.Title)); b.append("</div>"); if (a.Adres1 || a.Adres2) { b.append("<div class=\"Adres\">"); b.append(escapeHTML(a.Adres1)); b.append("<br />"); b.append(escapeHTML(a.Adres2)); b.append("</div>") } if (a.Text) { b.append("<div class=\"Tekst\">"); b.append(a.Text); b.append("</div>") } b.append("<div class=\"Link\">"); if (a.Link1 && myMapResponse.Link1) { var c = a.Link1; if (myMapResponse.LinkFormatString && a.Link1 && a.Link1.substring(0, 4) != "http") { c = String.format(myMapResponse.LinkFormatString, a.Link1) } b.append(String.format("<a class=\"sel{3}\" href=\"javascript:\" onclick=\"NavigateTo('{0}', {2}); return false;\" target=\"_blank\" >{1}</a>", c, myMapResponse.Link1, newWindow, a.Selected)) } if (a.Link2 && myMapResponse.Link2) { var d = newWindow; if (getFieldValue("newwindow") == "2") { d = true } b.append(String.format("<a href=\"javascript:\" onclick=\"NavigateTo('{0}', {2}); return false;\" target=\"_blank\" >{1}</a>", a.Link2, myMapResponse.Link2, d)) } if (!myMapResponse.Route || !a.IsMarker) { } else { var e = $get("hiddenRouteBtnTooltip").value; var f = $get("hiddenRouteBtn").value; if (IsRoutePlanned()) { e = $get("hiddenRouteBtnTooltip2").value; f = $get("hiddenRouteBtn2").value } b.append(String.format("<a class=\"clsRoute\" id=\"btnRoute\" href=\"javascript:\" onclick=\"javascript:return ShowRoute(true);\" title=\"{0}\">{1}</a>", e, f)) } b.append("</div>"); if (a.Image) { b.append("</td></tr></table>") } if (myMapResponse.PoweredBy) { b.append("<a href='http://www.objectmap.nl' target='_blank'><img border='0' src='/Images/PoweredByObjectmap.gif' /></a>") } return "<div class='divBallon'>" + b.toString() + "</div>" } function ToggleCollection(d, e) { var f = $get(e); myMap.closeInfoWindow(); if (d == -1) { Array.forEach(myMapResponse.Objects, function (a) { if (!a.Selected) { var b = a.Marker; if (f.checked) { b.show() } else { b.hide() } } }) } else { Array.forEach(myMapResponse.Collections, function (c) { if (c.Id == d) { Array.forEach(c.Objects, function (a) { var b = a.Marker; if (f.checked) { b.show() } else { b.hide() } }) } }) } } function ToggleSolo() { Array.forEach(myMapResponse.Objects, function (a) { if (!a.Selected) { var b = a.Marker; b.setPoint(new GLatLng(b.getPoint().lat() * -1, b.getPoint().lng() * -1)) } }) } function IsRoutePlanned() { return routeResultOpen } function ShowRoute(a) { if (ao.IsMarker) { routeObject = ao; var b = ao.Lat; var c = ao.Lng; var t = "<span id='spanRouteTitel'>" + escapeHTML(ao.Title) + "&nbsp;</span>"; var d = escapeHTML(ao.Adres1); var e = escapeHTML(ao.Adres2); if (IsRoutePlanned()) { var s = b + ", " + c; if (routeLatLng[routeLatLng.length - 1] != s) { routeLatLng.push(s); Control.Route() } var f = GetInfoWindowHtml(ao).toString(); AddHtmlInfo(ao, f) } else { if (d.length > 0 || e.length > 0) { t = t + "<span id='spanRouteAdres'><span class='spanRouteAdresH'>(</span>"; if (d.length > 0) { t = t + d; if (e.length > 0) { t = t + ", " } } t = t + e + "<span class='spanRouteAdresH'>)</span></span>" } if (routeBarOpen) { routeBarOpen = false; var g = (Sys.UI.DomElement.getBounds($get("MapDiv")).height + Sys.UI.DomElement.getBounds($get("divRoute")).height).toString() + "px"; $("#MapDiv").animate({ height: g }, "fast", function () { $get("MapDiv").focus(); ShowRoute(a) }); $("#divRoute").slideUp("fast"); return } routeBarOpen = true; $get("spanDest").innerHTML = t; var h = (Sys.UI.DomElement.getBounds($get("MapDiv")).height - 85).toString() + "px"; $get("divRouteResult").style.height = h; var t = (Sys.UI.DomElement.getBounds($get("MapDiv")).y + 60).toString() + "px"; $get("divRouteResult").style.top = t; h = (Sys.UI.DomElement.getBounds($get("MapDiv")).height - 25).toString() + "px"; $("#divRoute").slideDown("slow"); $("#MapDiv").animate({ height: h }, "slow", function () { if ($get("btnRoute")) { $get("btnRoute").style.display = "none" } myMap.checkResize(); if (a) { $get("TextRoute").focus() } }); routeLatLng = []; routeLatLng.push(b + ", " + c) } } return false } function HideRoute() { var h = (Sys.UI.DomElement.getBounds($get("MapDiv")).height + Sys.UI.DomElement.getBounds($get("divRoute")).height).toString() + "px"; routeBarOpen = false; routeResultOpen = false; $("#MapDiv").animate({ height: h }, "slow"); $("#divRoute").slideUp("slow"); $("#divRouteResult").fadeOut("fast"); myMap.checkResize(); gdir.clear(); ClearHtmlInfo(); if ($get("btnRoute")) { $get("btnRoute").style.display = "inline" } } function escapeHTML(a) { var b = document.createElement('div'); if (a) { var c = document.createTextNode(a); b.appendChild(c) } return b.innerHTML } function escapeAttribute(a) { if (a) { return a.replace("'", "\\\'").replace('"', '\\\"') } return '' } function onGDirectionsLoad() { $("#divRouteResult").fadeIn("slow"); routeResultOpen = true; var a = gdir.getMarker(gdir.getNumRoutes()).getIcon(); a.image = "/Images/Markers/empty.png"; a.shadow = a.image; a.printImage = a.image; var b = gdir.getPolyline(); b.opacity = 0.90 } function handleErrors() { if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS) { alert("Het adres kon niet gevonden worden. Voeg een plaats of een postcode toe aan het adres.") } else { if (gdir.getStatus().code == G_GEO_SERVER_ERROR) { alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code) } else { if (gdir.getStatus().code == G_GEO_MISSING_QUERY) { alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code) } else { if (gdir.getStatus().code == G_GEO_BAD_KEY) { alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code) } else { if (gdir.getStatus().code == G_GEO_BAD_REQUEST) { alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code) } else { alert("Het adres kon niet gevonden worden. Voeg een plaats of een postcode toe aan het adres.") } } } } } $get("TextRoute").select(); $get("TextRoute").focus() } function MyZoomControl() { } MyZoomControl.prototype = new GControl(); MyZoomControl.prototype.initialize = function (a) { return $get("ControlDiv") }; MyZoomControl.prototype.getDefaultPosition = function () { return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7)) }; function MyMapTypeControl() { } MyMapTypeControl.prototype = new GControl(); MyMapTypeControl.prototype.initialize = function (a) { return $get("KaartTypeDiv") }; MyMapTypeControl.prototype.getDefaultPosition = function () { return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 7)) }; function MyLegendaControl() { } MyLegendaControl.prototype = new GControl(); MyLegendaControl.prototype.initialize = function (a) { return $get("LegendaSpan") }; MyLegendaControl.prototype.getDefaultPosition = function () { return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 37)) }; function AddToTomTom() { if (ao) { var a = "/TomTom/Default.aspx?guid=" + ao.Guid + "&type=o"; var b = 600; var c = 605; var d = (screen.width - b) / 2; var e = (screen.height - c) / 2; this.newwindow = window.open(a, 'tt', 'status=1,resizable=1,menubar=0,scrollbars=1,width=' + b + ',height=' + c + ',top=' + e + ',left=' + d); if (window.focus) { this.newwindow.focus() } return false } } function createCookie(a, b, c) { if (c) { var d = new Date(); d.setTime(d.getTime() + (c * 24 * 60 * 60 * 1000)); var e = "; expires=" + d.toGMTString() } else var e = ""; document.cookie = a + "=" + b + e + "; path=/" } function readCookie(a) { var b = a + "="; var d = document.cookie.split(';'); for (var i = 0; i < d.length; i++) { var c = d[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(b) == 0) return c.substring(b.length, c.length) } return "" } function eraseCookie(a) { createCookie(a, "", -1) } var Control = new ClassControl(); Control.Initialize(); function ClassControl() { this.Initialize = function () { this.Areal = false; this.CurrentLink = false; this.MarkerMarge = 0; this.toggleControls = true }; this.PrintMap = function () { if (myMap) { $get("divRouteResultPrint").innerHTML = $get("divRouteResult2").innerHTML; window.print() } }; this.MouseoverImage = function (a) { a.src = a.src.replace('-n.gif', '-h.gif') }; this.MouseoutImage = function (a) { a.src = a.src.replace('-h.gif', '-n.gif') }; this.Dummy = function () { }; this.panDirection = function (x, y) { if (myMap) { myMap.panDirection(x, y) } }; this.KlikKaartType = function (a, b) { if (myMap) { $get("TabHYBRID").style.fontWeight = ""; $get("TabSATELLITE").style.fontWeight = ""; $get("TabNORMAL").style.fontWeight = ""; a.style.fontWeight = "bold"; if (b == 'NORMAL') { this.Areal = false; this.MarkerMarge = 0; $get('ControlDiv').className = 'Control'; $get('ControlDiv').style.height = 195 } else { this.Areal = true; this.MarkerMarge = 14; $get('ControlDiv').className = 'ControlAreal'; $get('ControlDiv').style.height = 204 } myMap.setMapType(eval('G_' + b + '_MAP')); myMap.checkResize(); this.onZoom() } }; this.Slide = function (a) { if (!this.Sliding) return; y = a.clientY - this.DeltaY; this.SetSliderPixels(y) }; this.StartSlide = function (a) { if (myMap) { this.DeltaY = a.clientY - $get('Slider').offsetTop; this.Sliding = true } }; this.StopSlide = function () { if (!this.Sliding || !myMap) return; this.Sliding = false; y = this.SliderPx - this.MarkerMarge; if (y < 2 - this.MarkerMarge) y = 2 - this.MarkerMarge; if (y > 72) y = 72; z = 17 - Math.round((y - 3) / 5); myMap.setZoom(z) }; this.ClickSlider = function (a, b) { if (myMap) { y = 4 - this.MarkerMarge; if (a.offsetY) { y = a.offsetY - y } else { y = (a.layerY) - y } if (y < 2 - this.MarkerMarge) y = 2 - this.MarkerMarge; if (y > 72) y = 72; this.SetSliderPixels(y); z = 17 - Math.round((y - 3) / 5); myMap.setZoom(z) } }; this.SetSliderPixels = function (y) { if (y < 2) y = 2; if (y > 72 + this.MarkerMarge) y = 72 + this.MarkerMarge; this.SliderPx = y; $get('Slider').style.top = y + 'px' }; this.SetSliderZoomlevel = function (z) { this.SliderPx = 72 + this.MarkerMarge - (z - 3) * 5; $get('Slider').style.top = this.SliderPx + 'px' }; this.ZoomEnd = function () { this.onZoom(); if (myMap.getZoom() <= 2) this.ZoomIn() }; this.onZoom = function () { if (myMap) { this.SetSliderZoomlevel(myMap.getZoom()) } }; this.ZoomIn = function () { if (myMap) { if (myMap.getZoom() >= 20) return; myMap.zoomIn() } }; this.ZoomOut = function () { if (myMap) { if (myMap.getZoom() <= 2) { return } myMap.zoomOut() } }; this.ClickCenter = function () { if (myMapResponse && myMap) { myMap.setCenter(new GLatLng(myMapResponse.Lat, myMapResponse.Lng), myMapResponse.Zoom); Array.forEach(myMapResponse.Objects, function (a) { if (a.Selected) openMyInfoWindowHtml(a) }) } }; this.ToggleControls = function () { if (this.toggleControls) { $get("KaartTypeDiv").style.display = "none"; $get("ControlDiv").style.display = "none"; $get("LegendaSpan").style.display = "none"; this.toggleControls = false } else { $get("KaartTypeDiv").style.display = ""; $get("ControlDiv").style.display = ""; $get("LegendaSpan").style.display = ""; this.toggleControls = true } }; this.Route = function () { var a = $get("TextRoute").value; if (a.length > 0) { createCookie("address", a, 10); var l = []; l.push(a); Array.addRange(l, routeLatLng); if ($get("CheckboxBack").checked) { l.push(a) } gdir.loadFromWaypoints(l, { "locale": $get("hiddenLocale").value, "preserveViewport": "false" }) } $get("TextRoute").focus() } } function StopSlide() { Control.StopSlide() } document.onmouseup = StopSlide; function ShowStreetview() { var a = new GStreetviewPanorama(document.getElementById("pano")); myPOV = { yaw: 370.64659986187695, pitch: -20 }; a.setLocationAndPOV(new GLatLng(ao.Lat, ao.Lng), myPOV); GEvent.addListener(a, "error", handleNoFlash) } function handleNoFlash(a) { if (a == 603) { alert("Error: Flash doesn't appear to be supported by your browser"); return } }
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();