var map;
var mapOptions = {
center: {
lat: 49.5,
lng: -126.5
},
zoom: 8,
maxZoom: 15,
minZoom: 7,
scaleControl: true
};
var labelArray = [];
var labelArraySub = [];
//initMap initiates all the styles and listeners
function initMap() {
map = new google.maps.Map(document.getElementById('map'), mapOptions);
var harvestPoints = new google.maps.Data();
harvestPoints.loadGeoJson('https://api.myjson.com/bins/1d9u6');
var harvestSubPoints = new google.maps.Data();
harvestSubPoints.loadGeoJson('https://api.myjson.com/bins/3g2qm');
function newLabel(feature) {
labelID = "lb" + feature.getProperty('MGNT_AREA').toString();
var LatLong = feature.getGeometry().get();
var label = new InfoBox({
content: feature.getProperty('MGNT_AREA'),
boxStyle: {
textAlign: "center",
fontSize: "8pt",
width: "50px"
},
disableAutoPan: true,
pixelOffset: new google.maps.Size(-25, -24),
position: LatLong,
closeBoxURL: "",
isHidden: false,
enableEventPropagation: true
});
label.open(map);
return label;
}
var areaIcon = function (feature) {
labelArray.push(newLabel(feature)); //this does not work for some reason
//there is a custom icon I use for the real page. I won't bother with it here.
return ({
icon: 'http://maps.google.com/mapfiles/ms/micons/blue.png'
});
};
var areaIconS = function (feature) {
labelArraySub.push(newLabel(feature)); //this does not work for some reason
//there is a custom icon I use for the real page. I won't bother with it here.
//return ({ icon: 'labels/num_icon.png' });
};
var vFalse = {
visible: false
};
var styleFeatures = function (hp, hsp) {
harvestPoints.setStyle(hp);
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.