Page view counter

Map Quest Module in 2.0.4 is still not working properly?

Last post 06-11-2004 8:20 AM by objecta. 31 replies.

Sort Posts:

  • Map Quest Module in 2.0.4 is still not working properly?

    04-25-2004, 7:16 PM
    • Loading...
    • tcchou
    • Joined on 03-21-2004, 7:50 AM
    • Posts 18
    • Points 90
    Firstly, thanks to core team to release DNN 2.0.4 two days ago... Excellent work...

    I was trying to configure the map module in my test server (W2K3, SQL 2000), but I could not make it work properly.

    If I configured "Display the Map" checked in the "Edit Map Quest", then screen will show the name of "Location" and the Map not shown under the neath of "Location"

    If I configured "Display the Map" unchecked in the "Edit Map Quest", then screen will show the name of "Location" and "Show Map", the Map not shown under the neath of both. If I clicked "Show Map" and it being directed to http://www.mapquest.com/maps/map.adp?address=297+queen+street&city=toronto&state=Ontario&country=Canada&zip=m4n+3j7&size=small&zoom=8

    Anyone has the same issue?

    Any feedback will be much appreciated...
    tchou

  • Re: Map Quest Module in 2.0.4 is still not working properly?

    04-25-2004, 10:31 PM
    • Loading...
    • bbrian
    • Joined on 04-20-2004, 3:33 PM
    • Posts 21
    • Points 105
    I had a problem with it as well.. I didn't fix the root cause, but in the file MapQuest.ascx comment out the second line in the function GetMapImageURL.
    (Dim strMapQuestURL As String = Convert.ToString(DataCache.GetCache("MapQuestURL" & ModuleId.ToString)))
    Basically the line to get the Image URL from cache doesn't work. I had tried fixing the line, but it also causes problem if the end-user changes the Zoom or Size.. Since it caches the URL to pull the image it ignores that the user has changed parameters that would require getting a new URL.

    This module needs some serious attention.. but commenting out that line will get it to work.
    -Brian Brown
  • Re: Map Quest Module in 2.0.4 is still not working properly?

    04-25-2004, 10:37 PM
    • Loading...
    • alfageek
    • Joined on 04-25-2004, 10:19 PM
    • Winston-Salem, NC, USA
    • Posts 47
    • Points 232
    My compliments to the core DNN team also. Great job!!!

    On this issue, I have also noticed it and have some additional observations that may help. I was using a "Text/HTML" module to hold a reference to a Weather.COM applet using <script> tags. Now if I place that module (with the script tags) on a page, I get a moduleloadexception and pageloadexception (NullReference) on the next attempt to add a module to the page (any module).

    I'm not sure where to start troubleshooting that one but like the doctor says ... "if it hurts when you do that .... don't do that anymore".

    Ken Ingram
    If you're going to be a Geek ... Be the Alpha Geek
  • Re: Map Quest Module in 2.0.4 is still not working properly?

    04-25-2004, 11:35 PM
    • Loading...
    • RLHarriman
    • Joined on 03-08-2004, 8:58 PM
    • Posts 77
    • Points 385
    To have the map display goto MapQuest.ascx.vb. Look for GetMapImageURL Function and replace (i.e line 167)

    //code

    If (strMapQuestURL Is Nothing) OrElse IgnoreCache Then

    with

    If (strMapQuestURL = "") OrElse IgnoreCache Then

    //end code


    also if one would like the Get Direction Link to Show to all users then.

    Remark these two lines at line 81

    //code
    ' If Request.IsAuthenticated Then ' RLH rem
    hypDirections.Text = "Get Directions"
    hypDirections.NavigateUrl = BuildDirectionsURL()
    ' End If ' RLH rem
    //end code

    and add after line 219

    //code
    Else 'RLH added
    //end code
    Robert

  • Re: Map Quest Module in 2.0.4 is still not working properly?

    04-26-2004, 9:25 PM
    • Loading...
    • tcchou
    • Joined on 03-21-2004, 7:50 AM
    • Posts 18
    • Points 90
    Hi, RHL,

    It's working under your instructions. Thank you very much...

    tchou
  • Re: Map Quest Module in 2.0.4 is still not working properly?

    04-26-2004, 10:25 PM
    • Loading...
    • RLHarriman
    • Joined on 03-08-2004, 8:58 PM
    • Posts 77
    • Points 385
    tcchou glad to help.

    I would like to add that if you remark
    [If Request.IsAuthenticated Then] at line 81
    this will through an exception at
    [Dim objUser As UserInfo = objUsers.GetUser(PortalId, Int32.Parse(context.User.Identity.Name))] at line 229.

    This is because if the user is logged in it will apply the user address.

    To resolve this I moved [If Request.IsAuthenticated Then] to line 231

    So to make it simple replace the code below



    // code


    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Try
    If Not Page.IsPostBack Then
    valid = True
    Select Case Nothing
    Case Settings("street")
    valid = False
    Case Settings("city")
    valid = False
    Case Settings("region")
    valid = False
    Case Settings("country")
    valid = False
    Case Settings("postalcode")
    valid = False
    End Select

    If valid Then
    If CType(Settings("location"), String) <> "" Then
    lblLocation.Text = CType(Settings("location"), String)
    ' RLH: rem - If Request.IsAuthenticated Then
    hypDirections.Text = "Get Directions"
    hypDirections.NavigateUrl = BuildDirectionsURL()
    ' RLH: rem - End If
    If CType(Settings("showaddress"), Boolean) Then
    lblAddress.Text = FormatAddress(CType(Settings("unit"), String), CType(Settings("street"), String), CType(Settings("city"), String), CType(Settings("region"), String), CType(Settings("country"), String), CType(Settings("postalcode"), String))
    End If
    End If

    If Not CType(Settings("defaultzoom"), String) = "" Then
    _zoom = CType(Settings("defaultzoom"), String)
    End If

    If Not CType(Settings("defaultsize"), String) = "" Then
    _size = CType(Settings("defaultsize"), String)
    End If

    If CType(Settings("customsize"), Boolean) Then
    colZoom.Visible = True
    colSize.Visible = True
    If Not cboZoom.Items.FindByValue(_zoom) Is Nothing Then
    cboZoom.ClearSelection()
    cboZoom.Items.FindByValue(_zoom).Selected = True
    End If
    If Not cboSize.Items.FindByValue(_size) Is Nothing Then
    cboSize.ClearSelection()
    cboSize.Items.FindByValue(_size).Selected = True
    End If
    Else
    colZoom.Visible = False
    colSize.Visible = False
    End If

    BuildMapImage()
    Else
    hypMap.Visible = False
    hypDirections.Visible = False
    colSize.Visible = False
    colZoom.Visible = False
    hypMapImage.BorderWidth = Unit.Pixel(0)
    hypMapImage.Visible = False
    If PortalSecurity.IsInRoles(PortalSettings.ActiveTab.AdministratorRoles.ToString) Then
    lblAddress.Text = "Address has not been entered."
    End If

    End If
    End If
    Catch exc As Exception 'Module failed to load
    ProcessModuleLoadException(Me, exc)
    End Try
    End Sub


    //end code






    //code


    Private Function GetMapImageURL(ByVal strURL As String, Optional ByVal IgnoreCache As Boolean = False) As String
    Try
    Dim strMapQuestURL As String = Convert.ToString(DataCache.GetCache("MapQuestURL" & ModuleId.ToString))

    If (strMapQuestURL = "") OrElse IgnoreCache Then ' RLH: changed (IsNothing) to (= "")
    Try

    Dim objRequest As HttpWebRequest = GetExternalRequest(strURL)

    Dim objResponse As HttpWebResponse = CType(objRequest.GetResponse(), HttpWebResponse)
    Dim sr As StreamReader
    sr = New StreamReader(objResponse.GetResponseStream())
    Dim strResponse As String = sr.ReadToEnd()
    sr.Close()

    Dim intPos1 As Integer
    Dim intPos2 As Integer

    intPos1 = InStr(1, strResponse, "mqmapgend")
    intPos1 = InStrRev(strResponse, "http://", intPos1)
    intPos2 = InStr(intPos1, strResponse, """")

    strMapQuestURL = Mid(strResponse, intPos1, intPos2 - intPos1)

    If Not IgnoreCache Then
    DataCache.SetCache("MapQuestURL" & ModuleId.ToString, strMapQuestURL)
    End If

    Catch ex As Exception
    ' TODO: add exeption handler
    End Try

    End If

    Return strMapQuestURL

    Catch exc As Exception 'Module failed to load
    ProcessModuleLoadException(Me, exc)
    End Try
    End Function


    //end code





    //code


    Private Function BuildDirectionsURL() As String
    Try
    Dim objRegionalController As New RegionalController
    Dim strURL As New StringBuilder

    strURL.Append("http://www.mapquest.com/directions/main.adp?go=1")
    strURL.Append("&2a=" & EncodeValue(CType(Settings("street"), String)))
    strURL.Append("&2c=" & EncodeValue(CType(Settings("city"), String)))
    If Not Settings("country") Is Nothing Then
    Select Case CType(Settings("country"), String).ToLower
    Case "united states", "canada"
    Dim w As String = objRegionalController.GetRegionByDescription(CType(Settings("region"), String)).Code
    strURL.Append("&2s=" & EncodeValue(objRegionalController.GetRegionByDescription(CType(Settings("region"), String)).Code))
    Case Else
    strURL.Append("&2s=" & EncodeValue(CType(Settings("region"), String)))
    End Select
    ' RLH: rem - hypDirections.Visible = False
    End If
    strURL.Append("&2y=" & EncodeValue(CType(Settings("country"), String)))
    strURL.Append("&2z=" & EncodeValue(CType(Settings("postalcode"), String)))

    Dim _portalSettings As PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings)

    If Request.IsAuthenticated Then ' RLH: added

    Dim objUsers As New UserController
    Dim objUser As UserInfo = objUsers.GetUser(PortalId, Int32.Parse(context.User.Identity.Name))

    If Not objUser Is Nothing Then
    strURL.Append("&1a=" & EncodeValue(objUser.Street))
    strURL.Append("&1c=" & EncodeValue(objUser.City))
    strURL.Append("&1s=" & EncodeValue(objUser.Region))
    strURL.Append("&1y=" & EncodeValue(objUser.Country))
    strURL.Append("&1z=" & EncodeValue(objUser.PostalCode))
    End If

    End If ' RLH: added

    Return strURL.ToString
    Catch exc As Exception 'Module failed to load
    ProcessModuleLoadException(Me, exc)
    End Try
    End Function


    //end code
    Robert

  • Re: Map Quest Module in 2.0.4 is still not working properly?

    04-30-2004, 10:10 PM
    • Loading...
    • tcchou
    • Joined on 03-21-2004, 7:50 AM
    • Posts 18
    • Points 90
    Hi, RLHarriman

    Last time, simply I went to the module and edited was OK following up your first reply, but I did not check after I got out of the editing mode until today. I found it did not work when regular users sign on. Then I read your last reply again. This time I tested carefully. It did work perfectly... Nice job

    Thank you for your help again...

    tcchou
  • Re: Map Quest Module in 2.0.4 is still not working properly?

    05-02-2004, 9:39 AM
    • Loading...
    • simonduz1
    • Joined on 08-11-2003, 9:47 PM
    • Posts 432
    • Points 2,160
    Would anyone be so kind as to post a private assembly version of this fix please?
    I and others that do not have the experience with VS.net and recompiling our code would be grateful for a working Mapquest module.

    Thanks again.
  • Re: Map Quest Module in 2.0.4 is still not working properly?

    05-02-2004, 10:49 AM
    • Loading...
    • Geert
    • Joined on 06-18-2002, 11:43 AM
    • The Netherlands
    • Posts 2,011
    • Points 10,052
    Being non-US, does anyone have an adress (or more) to test this with?

    I made the changes to the source and want to test it some more before putting it in source control.
    Geert Veenstra
  • Re: Map Quest Module in 2.0.4 is still not working properly?

    05-02-2004, 11:07 AM
    Try using 1060 W. Addison, Chicago IL 60613

    Just watching the Blues Brothers...
  • Re: Map Quest Module in 2.0.4 is still not working properly?

    05-02-2004, 11:17 AM
    • Loading...
    • patk
    • Joined on 11-10-2003, 7:38 AM
    • Weston-Super-Mare
    • Posts 92
    • Points 460
    Hi Geert
    Try this one Yate address hawkesworth Rd Bristol AVON BS37 5NW
    i,ve been trying this since RC2.0.4 without any joy(might help if I was a coder!)

    Pat
  • Re: Map Quest Module in 2.0.4 is still not working properly?

    05-02-2004, 11:36 AM
    • Loading...
    • cjsmitty
    • Joined on 06-29-2002, 3:35 PM
    • Rockford, IL
    • Posts 1,600
    • Points 8,010
    706 Horsman St
    Rockford, IL 61101


    1060 W Addison, Chicago...That's Wrigley Field.
    ~Chris

    Net Data Design
    706Horsman.us
  • Re: Map Quest Module in 2.0.4 is still not working properly?

    05-15-2004, 1:36 AM
    • Loading...
    • simonduz1
    • Joined on 08-11-2003, 9:47 PM
    • Posts 432
    • Points 2,160
    Any chance of getting a quick fix for this problem?
    The map quest module will not display maps.
    Thanks.
  • Re: Map Quest Module in 2.0.4 is still not working properly?

    05-15-2004, 6:58 AM
    • Loading...
    • photo_tom
    • Joined on 07-18-2003, 3:52 PM
    • Southern Wisconsin
    • Posts 231
    • Points 1,135
    Found a small problem after I pasted in all code from above.

    In BuildMapURL, change line

    strURL.Append("&zip=" & EncodeValue(CType(Settings("postalcode"), String)))

    to

    strURL.Append("&zipcode=" & EncodeValue(CType(Settings("postalcode"), String)))

    appears that maybe mapquest changed their interface.
    Anyway, this works on my system now.
  • Re: Map Quest Module in 2.0.4 is still not working properly?

    05-19-2004, 10:44 AM
    • Loading...
    • AggieTL
    • Joined on 08-30-2002, 1:16 PM
    • Posts 11
    • Points 55
    any news on when this will be "officially" fixed?
Page 1 of 3 (32 items) 1 2 3 Next >