Esempio n. 1
0
    public void Generate_Map()
    {
        if (MRT_Station != "")
        {
            Marker _marker_mrt = new Marker();
            _marker_mrt.Address = MRT_Station + " Station";
            _marker_mrt.Animation = MarkerAnimation.Drop;
            _marker_mrt.Title = "Nearest MRT: " + MRT_Station;
            _marker_mrt.Info = _marker_mrt.Address;

            MarkerImage _marker_image = new MarkerImage();
            _marker_image.Url = "../Images/train.png";
            _marker_mrt.Icon = _marker_image;
            google_map_default.Markers.Add(_marker_mrt);

        }
        if (Postal_Code != "")
        {
            Marker _marker = new Marker();
            _marker.Address = Postal_Code + " Singapore";
            _marker.Animation = MarkerAnimation.Drop;
            _marker.Title = "Postal Code: " + Postal_Code;
            _marker.Info = Postal_Code;
            google_map_default.Markers.Add(_marker);

        }
        google_map_default.DefaultAddress = (Postal_Code != "") ? Postal_Code + " Singapore" : MRT_Station + " MRT Singapore";
    }
        private void PopulateMap(IncidentDetails incidentDetails, AdddressDetails incidentAddr, StoreDetails loggedinUserAddress)
        {
            IncidentMap.MapType = MapType.Roadmap;
            IncidentMap.EnterpriseKey = Utility.GetGoogleAPIKey();
            IncidentMap.Latitude = incidentAddr.Latitude;
            IncidentMap.Longitude = incidentAddr.Longitude;
            IncidentMap.Zoom = Utility.GetGoogleZoomLevel(incidentAddr.Latitude, incidentAddr.Longitude, loggedinUserAddress.Store_Address.Latitude, loggedinUserAddress.Store_Address.Longitude);

            MarkerImage incidentMarkerIamge = new MarkerImage();
            incidentMarkerIamge.Url = "http://www.eyedentify.co.nz/Images/Map/map_Incident_Icon.jpg";

            MarkerImage homeMarkerIamge = new MarkerImage();
            homeMarkerIamge.Url = "http://www.eyedentify.co.nz/Images/Map/map_Home_Icon.png";

            Marker incidentMarker = new Marker();
            incidentMarker.Address = incidentAddr.Latitude + " " + incidentAddr.Longitude;
            incidentMarker.Info = incidentDetails.Description;
            incidentMarker.Icon = incidentMarkerIamge;
            IncidentMap.Markers.Add(incidentMarker);

            Marker yourAddressMarker = new Marker();
            yourAddressMarker.Address = loggedinUserAddress.Store_Address.Latitude + " " + loggedinUserAddress.Store_Address.Longitude;
            yourAddressMarker.Info = "Your Store";
            yourAddressMarker.Icon = homeMarkerIamge;
            IncidentMap.Markers.Add(yourAddressMarker);
        }