Property Data 2
new
by Brent Coder
HTML
<script src="https://maps.googleapis.com/maps/api/js?sensor=true"></script>
<title>Google Maps Example</title>
<body>
<div id="map" />
</body>
CSS
#map {
height: 480px;
width: 640px
}
JavaScript
$(window).on('load', function() {
// Construct the catalog query string
url = 'https://www.thedatazone.ca/resource/6a95-ppg4.json?$limit=100';
var infoWindow = new google.maps.InfoWindow();
var today = new Date();
var marker = [];
// Intialize our map
var center = new google.maps.LatLng(44.651070, -63.582687);
var mapOptions = {
zoom: 6,
center: center,
navigationControl: true,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.ZOOM_PAN,
position: google.maps.ControlPosition.TOP_LEFT
},
scaleControl: true,
scaleControlOptions: {
position: google.maps.ControlPosition.BOTTOM_LEFT
}
}
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
// Retrieve our data and plot it
$.getJSON(url, function(data, textstatus) {
//console.log(data);
$.each(data, function(i, entry) {
//try {
console.log('here now');
// entry.location.coordinates["0"]
// console.log('I guess you do exist')
// } catch (e) {
// entry.location.coordinates["0"].push(0);
// entry.location.coordinates["1"].push(0);
// console.log('An error has occurred: '+e.message);
// }
marker = new google.maps.Marker({
position: new google.maps.LatLng(entry.y_coord, entry.x_coord),
map: map,
title: entry.aan,
id: i
});
console.log('here 2');
//console.log(entry);
infowindow = new google.maps.InfoWindow({
//console.log(data.district_name[i]);
//content: data[i].district_name
position: new google.maps.LatLng(entry.y_coord, entry.x_coord),
id: i
});
//console.log(entry);
(function(marker, data) {
var dt = new Date(entry.sale_date);
var html = "Municipal Unit: " +...