Skip to content

Commit f2d7ba1

Browse files
author
Georgi Tenev
committed
The call to api was using a hardcoded link which was wrong.
1 parent 25ccd75 commit f2d7ba1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

application/static/js/home.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ var map;
1111

1212

1313

14+
var domain = document.location.origin;
1415
var init = function(locationName,zoomLevel) {
15-
//zoomLevel = 8;
16-
//var locationName = "Cambrige";
17-
if (!map) {
18-
var geoCodingAPI_URL = "http://localhost:8080/api/2/";
16+
//zoomLevel = 8;
17+
//var locationName = "Cambrige";
18+
if (!map) {
19+
var geoCodingAPI_URL = domain + "/api/2/";
20+
// var geoCodingAPI_URL = "http://localhost:8080/api/2/";
1921
$.getJSON( geoCodingAPI_URL+locationName).success(function( json ) {
2022
// convert name to coordinates using /api/2/
2123
var centerLocation = L.latLng(json["results"][0]["geometry"]["location"]["lat"],
@@ -44,7 +46,7 @@ var init = function(locationName,zoomLevel) {
4446

4547

4648
var zoomTo = function(locationName,zoomLevel) {
47-
var geoCodingAPI_URL = "http://localhost:8080/api/2/";
49+
var geoCodingAPI_URL = domain + "/api/2/England/";
4850
$.getJSON( geoCodingAPI_URL+locationName).success(function( json ) {
4951
// convert name to coordinates using /api/2/
5052
var centerLocation = L.latLng(json["results"][0]["geometry"]["location"]["lat"],

0 commit comments

Comments
 (0)