Skip to content

Commit e4071ee

Browse files
committed
.
1 parent 7b850d1 commit e4071ee

2 files changed

Lines changed: 66 additions & 25 deletions

File tree

devtracker.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@
6161
# Developer Machine: set global settings
6262
#set :oipa_api_url, 'https://fcdo-direct-indexing.iati.cloud/search/'#'https://fcdo.iati.cloud/search/'#'https://fcdo-direct-indexing.iati.cloud/search/'#'https://devtracker.fcdo.gov.uk/api/'
6363
# set :oipa_api_url, 'https://devtracker-entry.oipa.nl/api/'
64-
set :oipa_api_url, 'https://fcdo.iati.cloud/search/'
64+
# set :oipa_api_url, 'https://fcdo.iati.cloud/search/'
6565
# set :oipa_api_url, 'https://fcdo-direct-indexing.iati.cloud/search/'
6666
#set :bind, '0.0.0.0' # Allows for vagrant pass-through whilst debugging
6767

6868
# Server Machine: set global settings to use varnish cache
69-
#set :oipa_api_url, 'http://127.0.0.1:6081/search/'
69+
set :oipa_api_url, 'http://127.0.0.1:6081/search/'
7070
set :prod_api_url, 'https://fcdo.iati.cloud'
7171
set :dev_api_url, 'https://fcdo-staging.iati.cloud'
7272

public/javascripts/countrypagemap_new.js

Lines changed: 64 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ $(document).ready(function () {
5454
});
5555
// Create a blank array that will hold the country list for drawing border polygons
5656
var countryList = [];
57+
var tcl = [];
5758
// Set the zoom level based on the type of map
5859
if (mapType == 'country') {
5960
if (countryBounds[window.countryCode][2] != null) {
@@ -100,29 +101,50 @@ $(document).ready(function () {
100101
$.each(countryMapData, function (i, v) {
101102
var calculatedOpacity = calculateOpacity(v.extra.budget, maxBudget);
102103
var fOpacity = 0.8;
103-
// if (v.extra.id == 'SO') {
104-
// calculatedOpacity = 0;
105-
// fOpacity = 0;
106-
// }
107-
var tempMapBorder = {
108-
"type": "Feature",
109-
"properties": {
110-
"popupContent": getPopupHTML(v.extra),
111-
"style": {
112-
stroke: true,
113-
weight: 1,
114-
color: "white",
115-
opacity: calculatedOpacity,
116-
fillColor: calculateBrightness(v.extra.budget, maxBudget),
117-
fillOpacity: fOpacity
104+
if (v.extra.id == 'SO' || v.extra.id == '-99SOM') {
105+
calculatedOpacity = 0;
106+
fOpacity = 0;
107+
var tempMapBorder = {
108+
"type": "Feature",
109+
"properties": {
110+
"popupContent": getPopupHTML(v.extra),
111+
"style": {
112+
stroke: true,
113+
weight: 0,
114+
color: "white",
115+
opacity: calculatedOpacity,
116+
fillColor: calculateBrightness(v.extra.budget, maxBudget),
117+
fillOpacity: fOpacity
118+
}
119+
},
120+
"geometry": {
121+
"type": v.geometry.type,
122+
"coordinates": v.geometry.coordinates
118123
}
119-
},
120-
"geometry": {
121-
"type": v.geometry.type,
122-
"coordinates": v.geometry.coordinates
123-
}
124-
};
125-
countryList.push(tempMapBorder);
124+
};
125+
tcl.push(tempMapBorder);
126+
}
127+
else {
128+
var tempMapBorder = {
129+
"type": "Feature",
130+
"properties": {
131+
"popupContent": getPopupHTML(v.extra),
132+
"style": {
133+
stroke: true,
134+
weight: 1,
135+
color: "white",
136+
opacity: calculatedOpacity,
137+
fillColor: calculateBrightness(v.extra.budget, maxBudget),
138+
fillOpacity: fOpacity
139+
}
140+
},
141+
"geometry": {
142+
"type": v.geometry.type,
143+
"coordinates": v.geometry.coordinates
144+
}
145+
};
146+
countryList.push(tempMapBorder);
147+
}
126148
});
127149
var info = L.control();
128150

@@ -234,14 +256,33 @@ $(document).ready(function () {
234256
return L.circleMarker(latlng, {
235257
radius: 6,
236258
fillColor: "red",
237-
color: "black",
259+
color: "white",
238260
weight: 1,
239261
opacity: 1,
240262
fillOpacity: 0.3
241263
});
242264
}
243265
}).addTo(map);
244266

267+
L.geoJSON(tcl, {
268+
style: function (feature) {
269+
return feature.properties && feature.properties.style;
270+
},
271+
272+
onEachFeature: onEachFeature,
273+
274+
pointToLayer: function (feature, latlng) {
275+
return L.circleMarker(latlng, {
276+
radius: 6,
277+
fillColor: "red",
278+
color: "green",
279+
weight: 0,
280+
opacity: 0,
281+
fillOpacity: 0
282+
});
283+
}
284+
}).addTo(map);
285+
245286
//Draw each of the markers based on the API data and add them to the main leaflet map
246287
var markers = L.markerClusterGroup({ chunkedLoading: true });
247288
$.each(mapMarkers, function (index, marker) {

0 commit comments

Comments
 (0)