var ml=ml||{};ml.communities={mapInstance:new ml.map("js-communities-map"),renderCommunityPins:function(coms){var locations=[];for(var key in coms){var pin=this.mapInstance.addPin(key,[coms[key].lat,coms[key].lon],{cursor:"pointer",icon:"//"+mlVars.cdn+"/consumer/map/ico_mappoint.png",anchor:new Microsoft.Maps.Point(18,18),disableScrollWheelZoom:!0},{name:coms[key].name},this.pinEvents);locations.push(pin.getLocation())}this.mapInstance.showAllPins(),this.mapInstance.zoomToPins()},pinEvents:{mouseover:function(e){ml.communities.mapInstance.infobox.setOptions({location:e.target.getLocation(),visible:!0,cursor:"pointer",description:e.target.metaData.name})},mouseout:function(e){ml.communities.mapInstance.infobox.setOptions({visible:!1})},click:function(e){window.location.href="/community/area/"+e.target.metaData.name}}},$(document).on("bingMapsLoaded",(function(){ml.map.bingMapReady&&$("#"+ml.communities.mapInstance.mapElement).length&&(ml.communities.mapInstance.initMap(!0,{disableScrollWheelZoom:!0}),ml.communityBoundary?ml.communities.mapInstance.createGeoLayer((function(){var geoJSON=ml.communities.mapInstance.coordinateStringToGeoJSON(ml.communityBoundary);ml.communities.mapInstance.updateGeoLayer(geoJSON),ml.communities.mapInstance.zoomToPolygon(geoJSON.coordinates[0])})):ml.communities.renderCommunityPins(ml.communitiesList))}));