Skip to content
Snippets Groups Projects
Commit 0254f4fe authored by Rhys Evans's avatar Rhys Evans
Browse files

Began adding map iframe for each trail

parent 94ea2461
No related branches found
No related tags found
1 merge request!40Resolve "As a user I would like to see a map containing all landmarks for a trail and a suggested path between them, so that I can easily follow the trail"
......@@ -74,7 +74,7 @@ insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLon
insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (3, 51.575372, -3.219186);
insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (4, 51.576363, -3.220712 );
insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (9, 51.57239, -3.21992);
insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (10, 51.57229, -3.21937 );
insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (10, 51.57230, -3.21938 );
insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (13, 51.57168, -3.21861);
insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (14, 51.57465, -3.22022 );
insert into locationCoordinates(locationID, locationCoordsLat, locationCoordsLong) value (17, 51.61117, -3.10198 );
......
......@@ -8,6 +8,33 @@
<main>
<div th:each="trail, indexValue:${trails}">
<H1 th:text="*{trail.getTrailName()}"></H1>
<div th:if="*{trail.getTrailName()=='Caerphilly Castle Trail'}">
<iframe
width="600"
height="400"
frameborder="0"
scrolling="yes"
marginheight="0"
marginwidth="0"
src="https://www.google.com/maps/dir/51.57623,-3.21910/51.575372,-3.219186/51.576363,-3.220712//@11z">
</iframe>
</div>
<div th:if="*{trail.getTrailName()=='Caerphilly Pub Trail'}">
<iframe
width="600"
height="400"
frameborder="0"
scrolling="yes"
marginheight="0"
marginwidth="0"
th:src="'https://www.google.com/maps/dir/51.57239,-3.21992/51.57230,-3.21938//@11z'">
</iframe>
</div>
<div th:each="locationCoord, indexValue2:${locationCoords}" >
<div th:if="${locations[indexValue2.index].getLocationTrailID()==trail.getTrailsId()}">
<li>
......@@ -16,16 +43,15 @@
</li>
<iframe
width="600"
height="400"
frameborder="0"
scrolling="yes"
marginheight="0"
marginwidth="0"
th:src="'https://maps.google.com/maps?q='+ ${coord.getLocationCoordsLat()} +','+ ${coord.getLocationCoordsLong()} +'&hl=en&z=20&amp;output=embed'">
</iframe>
<!-- <iframe-->
<!-- width="600"-->
<!-- height="400"-->
<!-- frameborder="0"-->
<!-- scrolling="yes"-->
<!-- marginheight="0"-->
<!-- marginwidth="0"-->
<!-- th:src="'https://maps.google.com/maps?q='+ ${coord.getLocationCoordsLat()} +','+ ${coord.getLocationCoordsLong()} +'&hl=en&z=20&amp;output=embed'">-->
<!-- </iframe>-->
......
//package Team5.SmartTowns.data;
//import org.junit.platform.commons.util.Preconditions;
//
import Team5.SmartTowns.data.Location;
import Team5.SmartTowns.data.LocationRepository;
import Team5.SmartTowns.data.LocationRepositoryJDBC;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import static org.junit.jupiter.api.Assertions.assertEquals;
//@SpringBootTest
public class testTwo {
private JdbcTemplate jdbcTemplate;
private LocationRepositoryJDBC locationRepositoryJDBC;
private RowMapper<Location> locationMapper;
@Autowired
private LocationRepository locationRepository;
@Autowired
public void LocationRepositoryJDBC(JdbcTemplate jdbc){
this.jdbcTemplate = jdbc;
locationRepositoryJDBC = new LocationRepositoryJDBC(jdbc);
}
@BeforeAll
public static void setUp(){
locationRepository = new LocationRepositoryJDBC.getAllLocation();
// locationRepository = (LocationRepositoryJDBC) locationRepository.getAllLocation();
}
@Test
public void test(){
int aa=1;
assertEquals(1,aa);
}
}
////package Team5.SmartTowns.data;
//
////import org.junit.platform.commons.util.Preconditions;
////
//import Team5.SmartTowns.data.Location;
//import Team5.SmartTowns.data.LocationRepository;
//import Team5.SmartTowns.data.LocationRepositoryJDBC;
//import org.junit.jupiter.api.BeforeAll;
//import org.junit.jupiter.api.Test;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.jdbc.core.JdbcTemplate;
//import org.springframework.jdbc.core.RowMapper;
//
//import static org.junit.jupiter.api.Assertions.assertEquals;
//
//
////@SpringBootTest
//public class testTwo {
//
//private JdbcTemplate jdbcTemplate;
//private LocationRepositoryJDBC locationRepositoryJDBC;
//
//private RowMapper<Location> locationMapper;
//
//@Autowired
//private LocationRepository locationRepository;
//
//
//@Autowired
// public void LocationRepositoryJDBC(JdbcTemplate jdbc){
// this.jdbcTemplate = jdbc;
// locationRepositoryJDBC = new LocationRepositoryJDBC(jdbc);
//}
//
//
//@BeforeAll
//public static void setUp(){
// locationRepository = new LocationRepositoryJDBC.getAllLocation();
//// locationRepository = (LocationRepositoryJDBC) locationRepository.getAllLocation();
//}
//
//@Test
//public void test(){
// int aa=1;
// assertEquals(1,aa);
//
// }
//
//
//
//}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment