mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
Map marker now blue, removed parent map that was causing api errors
This commit is contained in:
parent
22d8d55f87
commit
e328e85e1f
4 changed files with 3 additions and 53 deletions
BIN
src/main/resources/static/resources/images/blue_MarkerA.png
Executable file
BIN
src/main/resources/static/resources/images/blue_MarkerA.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
src/main/resources/static/resources/images/bluemarker.png
Normal file
BIN
src/main/resources/static/resources/images/bluemarker.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
|
@ -72,7 +72,7 @@
|
||||||
geocoder.geocode( { 'address': alpha}, function(results, status) {
|
geocoder.geocode( { 'address': alpha}, function(results, status) {
|
||||||
map.setCenter(results[0].geometry.location);
|
map.setCenter(results[0].geometry.location);
|
||||||
var marker = new google.maps.Marker({
|
var marker = new google.maps.Marker({
|
||||||
map: map, position: results[0].geometry.location});
|
map: map, icon: "/resources/images/blue_MarkerA.png", position: results[0].geometry.location});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -112,57 +112,7 @@
|
||||||
//var map, infoWindow;
|
//var map, infoWindow;
|
||||||
|
|
||||||
|
|
||||||
var map;
|
|
||||||
var geocoder;
|
|
||||||
|
|
||||||
function initialize() {
|
|
||||||
|
|
||||||
geocoder= new google.maps.Geocoder();
|
|
||||||
var latlng = new google.maps.LatLng(-34.397, 150.644);
|
|
||||||
var mapOptions = {
|
|
||||||
zoom: 8,
|
|
||||||
center: latlng
|
|
||||||
}
|
|
||||||
map = new google.maps.Map(document.getElementById('map'), mapOptions);
|
|
||||||
//map.codeAddress();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// function getCoordinates(address, callback){
|
|
||||||
// var coordinates;
|
|
||||||
// geocoder.geocode({ address: address}, function (results, status) {
|
|
||||||
// coords_obj = results[0].geometry.location;
|
|
||||||
// coordinates = [coords_obj.nb,coords_obj.ob];
|
|
||||||
// callback(coordinates);
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function codeAddress() {
|
|
||||||
var address1 = /*[[${parent.address}]]*/;
|
|
||||||
var city = (/*[[${parent.city}]]*/);
|
|
||||||
var space = " ";
|
|
||||||
var addressHelp = address1.concat(space);
|
|
||||||
var state = /*[[${parent.state}]]*/;
|
|
||||||
var comma = " , ";
|
|
||||||
var addressHelpHelp = addressHelp.concat(city);
|
|
||||||
var address = addressHelpHelp.concat(state);
|
|
||||||
console.log(/*[[${parent.state}]]*/)
|
|
||||||
console.log(/*[[${parent.address}]]*/);
|
|
||||||
|
|
||||||
geocoder.geocode( { 'address': address}, function(results, status) {
|
|
||||||
if (status == 'OK') {
|
|
||||||
map.setCenter(results[0].geometry.location);
|
|
||||||
var marker = new google.maps.Marker({
|
|
||||||
map: map,
|
|
||||||
position: results[0].geometry.location
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
alert('Geocode was not successful for the following reason: ' + status);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -230,7 +180,7 @@
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="map" ></div>
|
|
||||||
<!-- <p th:text="${doctors.doctorList}" /> -->
|
<!-- <p th:text="${doctors.doctorList}" /> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue