Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moving

  • Loading branch information...
commit 007b5527109bf5ff3331bcc40a02943224c1ad83 1 parent 7f0e871
@jsikorski authored
View
2  MedicalLocator.WebFront/Content/GoogleMaps.css
@@ -1,4 +1,4 @@
-html, body, #google_map_div
+html, body
{
margin: 0;
padding: 0;
View
BIN  MedicalLocator.WebFront/Content/Graphics/Icons/dentist.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  MedicalLocator.WebFront/Content/Graphics/Icons/doctor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  MedicalLocator.WebFront/Content/Graphics/Icons/health.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  MedicalLocator.WebFront/Content/Graphics/Icons/hospital.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  MedicalLocator.WebFront/Content/Graphics/Icons/pharmacy.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  MedicalLocator.WebFront/Content/Graphics/Icons/physotherapist.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  MedicalLocator.WebFront/Content/Graphics/Icons/user.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 MedicalLocator.WebFront/Content/Menu.css
@@ -1,4 +1,5 @@
-#menu {
+#menu
+{
background: black;
border-bottom-color: white;
border-bottom-width: 1px;
@@ -15,22 +16,21 @@
text-decoration: none;
color: white;
background: transparent;
+
}
-.menu_item button
+.menu_item a
{
- cursor: pointer;
font-family: inherit;
font-size: inherit;
text-decoration: none;
color: inherit;
background: inherit;
- border: none;
}
.menu_item:hover {
color: #C9E1AF;
- cursor: wait;
+ cursor: pointer;
}
#login_block {
View
45 MedicalLocator.WebFront/Content/Site.css
@@ -1,47 +1,45 @@
body
{
font-size: .85em;
- font-family: "Trebuchet MS", Verdana, Helvetica, Sans-Serif;
+ font-family: "Trebuchet MS" , Verdana, Helvetica, Sans-Serif;
color: #232323;
background-color: #fff;
}
-header,
-footer,
-nav,
-section {
+header, footer, nav, section
+{
display: block;
}
/* Styles for basic forms
-----------------------------------------------------------*/
-fieldset
+fieldset
{
- border:1px solid #ddd;
- padding:0 1.4em 1.4em 1.4em;
- margin:0 0 1.5em 0;
+ border: 1px solid #ddd;
+ padding: 0 1.4em 1.4em 1.4em;
+ margin: 0 0 1.5em 0;
}
-legend
+legend
{
- font-size:1.2em;
+ font-size: 1.2em;
font-weight: bold;
}
-textarea
+textarea
{
min-height: 75px;
}
-.editor-label
+.editor-label
{
margin: 1em 0 0 0;
}
-.editor-field
+.editor-field
{
- margin:0.5em 0 0 0;
+ margin: 0.5em 0 0 0;
}
@@ -74,15 +72,26 @@ textarea
display: none;
}
-#overlay
+#overlay
{
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
- background: black;
- opacity: 0.3;
+ background: white;
+ opacity: 0.4;
z-index: 1;
display: none;
}
+
+#busy_image
+{
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ width: 100px;
+ height: 100px;
+ margin-top: -50px;
+ margin-left: -50px;
+}
View
7 MedicalLocator.WebFront/MedicalLocator.WebFront.csproj
@@ -113,6 +113,13 @@
<ItemGroup>
<Content Include="Content\GoogleMaps.css" />
<Content Include="Content\Graphics\busy.gif" />
+ <Content Include="Content\Graphics\Icons\dentist.png" />
+ <Content Include="Content\Graphics\Icons\doctor.png" />
+ <Content Include="Content\Graphics\Icons\health.png" />
+ <Content Include="Content\Graphics\Icons\hospital.png" />
+ <Content Include="Content\Graphics\Icons\pharmacy.png" />
+ <Content Include="Content\Graphics\Icons\physotherapist.png" />
+ <Content Include="Content\Graphics\Icons\user.png" />
<Content Include="Content\Menu.css" />
<Content Include="Content\themes\base\images\ui-bg_flat_0_aaaaaa_40x100.png" />
<Content Include="Content\themes\base\images\ui-bg_flat_75_ffffff_40x100.png" />
View
115 MedicalLocator.WebFront/Scripts/MedicalLocator/googleMaps.js
@@ -1,9 +1,89 @@
googleMapsManager = new GoogleMapsManager();
+function MedicalMarkerOptions() {
+ this.location = null;
+ this.name = null;
+ this.vicinity = null;
+ this.type = null;
+}
+
+MedicalMarkerType = {
+ User: 0,
+ Doctor: 1,
+ Dentist: 2,
+ Health: 3,
+ Hospital: 4,
+ Pharmacy: 5,
+ Physotherapist: 6,
+
+ fromNumber: function (number) {
+ switch (number) {
+ case 0:
+ return this.Doctor;
+ case 1:
+ return this.Dentist;
+ case 2:
+ return this.Health;
+ case 3:
+ return this.Hospital;
+ case 4:
+ return this.Pharmacy;
+ case 5:
+ return this.Physotherapist;
+ }
+ }
+};
+
+function MarkerTypeToIconUrlConverter() {
+ this.convert = function (markerType) {
+ var urlBase = "/Content/Graphics/Icons/";
+ var iconFileName;
+
+ switch (markerType) {
+ case MedicalMarkerType.User:
+ iconFileName = "user.png";
+ break;
+ case MedicalMarkerType.Doctor:
+ iconFileName = "doctor.png";
+ break;
+ case MedicalMarkerType.Dentist:
+ iconFileName = "dentist.png";
+ break;
+ case MedicalMarkerType.Health:
+ iconFileName = "health.png";
+ break;
+ case MedicalMarkerType.Hospital:
+ iconFileName = "hospital.png";
+ break;
+ case MedicalMarkerType.Pharmacy:
+ iconFileName = "pharmacy.png";
+ break;
+ case MedicalMarkerType.Physotherapist:
+ iconFileName = "physotherapist.png";
+ break;
+ default:
+ throw "Invalid marker type";
+ }
+
+ return urlBase + iconFileName;
+ };
+}
+
function GoogleMapsManager() {
var googleMapsApi = window.google.maps;
var map;
var markers = [];
+ var medicalTypeToMarkerUrlConverter = new MarkerTypeToIconUrlConverter();
+
+ var addInfoWindowForMarker = function (marker, markerName, vicinity) {
+ var contentString = "<div class='info_window_content'><h2>" + markerName + "</h2><p>" + vicinity + "</p></div>";
+ var infowindow = new google.maps.InfoWindow({
+ content: contentString
+ });
+ googleMapsApi.event.addListener(marker, 'click', function () {
+ infowindow.open(map, marker);
+ });
+ };
this.initializeMap = function (googleMapDomElement) {
var mapOptions = {
@@ -15,31 +95,23 @@ function GoogleMapsManager() {
map = new googleMapsApi.Map(googleMapDomElement, mapOptions);
};
- this.addMarker = function (markerLocation, markerName) {
+ this.addMarker = function (medicalMarkerOptions) {
+ var markerLocation = medicalMarkerOptions.location;
+ var markerName = medicalMarkerOptions.name;
+ var vicinity = medicalMarkerOptions.vicinity;
+ var markerType = medicalMarkerOptions.type;
+
var position = new googleMapsApi.LatLng(markerLocation.Lat, markerLocation.Lng);
+ var markerIconUrl = medicalTypeToMarkerUrlConverter.convert(markerType);
+
var newMarker = new googleMapsApi.Marker({
position: position,
map: map,
- title: markerName
- });
-
- var contentString = "<div class='info_window_content'><h1>" + markerName + "</h1></div>";
-
- var infowindow = new google.maps.InfoWindow({
- content: contentString
- });
-
- google.maps.event.addListener(infowindow, 'domready', function () {
- $('.info_window_content').parent().parent().css('margin-top', '15px');
- var height = $('.info_window_content').parent().parent().height();
- height = height - 15;
- $('info_window_content').parent().parent().height(height);
- });
-
- googleMapsApi.event.addListener(newMarker, 'click', function () {
- infowindow.open(map, newMarker);
+ title: markerName,
+ icon: markerIconUrl
});
+ addInfoWindowForMarker(newMarker, markerName, vicinity);
markers.push(newMarker);
};
@@ -58,4 +130,7 @@ function GoogleMapsManager() {
}
map.fitBounds(markersBounds);
};
-}
+}
+
+
+
View
35 MedicalLocator.WebFront/Scripts/MedicalLocator/searching.js
@@ -2,30 +2,47 @@ function SearchingManager() {
var geoLocationProvider = new GeoLocationProvider();
- var onLocationFoundForFindNearby = function(location) {
+ var onLocationFoundForFindNearby = function (location) {
+ var userLongitude = location.coords.longitude;
+ var userLatitude = location.coords.latitude;
+
$.ajax({
url: "Searching/FindNearby",
- data: { longitude: location.coords.longitude, latitude: location.coords.latitude },
- success: onSearchSuccess
+ data: { longitude: userLongitude, latitude: userLatitude },
+ success: function (response) { onSearchSuccess(response, userLongitude, userLatitude); }
});
};
- var onSearchSuccess = function (response) {
+ var onSearchSuccess = function (response, userLongitude, userLatitude) {
if (response == "Failure") {
busyIndicator.endBusy();
return;
}
googleMapsManager.clearMarkers();
+ placeUserMarkerOnGoogleMaps(userLongitude, userLatitude);
var foundObjects = response.Results;
placeMarkersOnGoogleMaps(foundObjects);
- busyIndicator.endBusy();
+
+ busyIndicator.endBusy();
+ };
+
+ var placeUserMarkerOnGoogleMaps = function (longitude, latitude) {
+ var markerOptions = new MedicalMarkerOptions();
+ markerOptions.name = "Me";
+ markerOptions.vicinity = "User location.";
+ markerOptions.location = { Lat: latitude, Lng: longitude };
+ markerOptions.type = MedicalMarkerType.User;
+ googleMapsManager.addMarker(markerOptions);
};
- var placeMarkersOnGoogleMaps = function(foundObjects) {
+ var placeMarkersOnGoogleMaps = function (foundObjects) {
for (var i = 0; i < foundObjects.length; i++) {
- var location = foundObjects[i].Location;
- var name = foundObjects[i].Name;
- googleMapsManager.addMarker(location, name);
+ var markerOptions = new MedicalMarkerOptions();
+ markerOptions.name = foundObjects[i].Name;
+ markerOptions.location = foundObjects[i].Location;
+ markerOptions.vicinity = foundObjects[i].Vicinity;
+ markerOptions.type = MedicalMarkerType.fromNumber(foundObjects[i].Type);
+ googleMapsManager.addMarker(markerOptions);
}
googleMapsManager.fitMapBounds();
};
View
9 MedicalLocator.WebFront/Views/Home/_GoogleMapsMapPartial.cshtml
@@ -2,7 +2,12 @@
<script type="text/javascript">
$(function () {
- var googleMapDomElement = $("#google_map_div")[0];
- googleMapsManager.initializeMap(googleMapDomElement);
+ var googleMapElement = $("#google_map_div");
+
+ var bodyHeight = $("body").height();
+ var menuHeight = $("#menu").height();
+ googleMapElement.height(bodyHeight - menuHeight - 1);
+
+ googleMapsManager.initializeMap(googleMapElement[0]);
});
</script>
View
4 MedicalLocator.WebFront/Views/Shared/_LoginPartial.cshtml
@@ -1,10 +1,10 @@
<div id="login_block" class="menu_item">
@if (User.Identity.IsAuthenticated)
{
- <button>@User.Identity.Name</button>
+ <a>@User.Identity.Name</a>
}
else
{
- <button>Login</button>
+ <a>Login</a>
}
</div>
View
2  MedicalLocator.WebFront/Views/Shared/_MenuPartial.cshtml
@@ -8,7 +8,7 @@
@helper MenuItem(string elementId, string itemText) {
<div id="@elementId" class="menu_item">
- <button>@itemText</button>
+ <a>@itemText</a>
</div>
}
View
1  MedicalLocator.WebFront/Views/Shared/_OverlayPartial.cshtml
@@ -1,2 +1,3 @@
<div id="overlay">
+ <img id="busy_image" src="@Url.Content("~/Content/Graphics/busy.gif")"/>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.