Results 1 to 3 of 3

Thread: Regarding Map Directions

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2009
    Location
    India
    Posts
    94

    Regarding Map Directions

    Hi All,

    I am working with google map using vb. I want to get the direction according to latitude and longitude for that I wrote the code like bellow in vb

    tt = "<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Strict//EN""" & vbCrLf & """http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"">" & vbCrLf & "<html xmlns=""http://www.w3.org/1999/xhtml"">" & vbCrLf & _
    "<head>" & vbCrLf & "<meta http-equiv=""content-type"" content=""text/html; charset=utf-8""/>" & vbCrLf & "<title>Control Initialization</title>" & vbCrLf & _
    "<script src=""http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"" type=""text/javascript""></script>" & vbCrLf & _
    "<script type=""text/javascript"">" & vbCrLf & "//<![CDATA[" & vbCrLf & "function initialize() {" & vbCrLf & "if (GBrowserIsCompatible()) {" & vbCrLf & " // define the crosshair tile layer and its required functions" & vbCrLf & _
    "var crossLayer = new GTileLayer(new GCopyrightCollection(""""), 0, 15);" & vbCrLf & "crossLayer.getTileUrl = function(tile, zoom) {" & vbCrLf & " return ""./include/tile_crosshairs.png"";" & vbCrLf & "}" & vbCrLf & _
    "crossLayer.isPng = function() {return true;}" & vbCrLf & "" & vbCrLf & "// Create a new map type incorporating the tile layer" & vbCrLf & "var layerTerCross = [ G_PHYSICAL_MAP.getTileLayers()[0]," & vbCrLf & _
    "crossLayer ];" & vbCrLf & "var mtTerCross = new GMapType(layerTerCross," & vbCrLf & "G_PHYSICAL_MAP.getProjection(), ""Ter+"");" & vbCrLf & "" & vbCrLf & "var map = new GMap2(document.getElementById(""map_canvas"")," & vbCrLf & _
    "{ size: new GSize(DesignedByArquineWidth,DesignedByArquineHeight) } );" & vbCrLf & _
    "var directionsPanel = document.getElementById(""route"");" & vbCrLf & _
    "var directions = new GDirections(map, directionsPanel);" & vbCrLf & _
    "map.addMapType(G_PHYSICAL_MAP);" & vbCrLf & "map.addMapType(mtTerCross);"

    tt = tt & " var hyd" & m1 & "= new GMarker( new GLatLng (" & CStr(dla3) & "," & CStr(dlon3) & ")" & "," & "markerOptions" & ");" & vbCrLf & _
    "GEvent.addListener (hyd" & m1 & "," & " ""mouseover"" " & "," & " function() {" & vbCrLf & _
    "hyd" & m1 & " .openInfoWindowHtml (" & """" & d3 & tm & """" & ");" & vbCrLf & _
    "});" & vbCrLf & _
    "map.addOverlay (hyd" & m1 & ");"

    tt = tt & "var point1 = [new GLatLng(" & CStr(dla3) & "," & CStr(dlon3) & ")" & "," & "new GLatLng(" & CStr(lat2) & "," & CStr(lon2) & ")];" & vbCrLf & _
    "var line = new GPolyline(point1" & "," & """" & hval & """" & "," & 2 & ");" & vbCrLf & _
    "directions.load(" & "new GLatLng(" & CStr(dla3) & "," & CStr(dlon3) & ")" & " ," & "new GLatLng(" & CStr(lat2) & "," & CStr(lon2) & ") " & ");"

    but i am not getting directions for that where should i modify code please let me know

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Regarding Map Directions

    venky is an unknown quantity at this point (<10)

    Regarding Map Directions
    Hi All,

    I am working with google map using vb. I want to get the direction according to latitude and longitude for that I wrote the code like bellow in vb
    Edit:

    Please wrap your code in [ highlight="vb"] [ /highlight="vb"] like so:

    vb Code:
    1. tt = "<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Strict//EN""" & vbCrLf & """http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"">" & vbCrLf & "<html xmlns=""http://www.w3.org/1999/xhtml"">" & vbCrLf & _
    2. "<head>" & vbCrLf & "<meta http-equiv=""content-type"" content=""text/html; charset=utf-8""/>" & vbCrLf & "<title>Control Initialization</title>" & vbCrLf & _
    3. "<script src=""http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"" type=""text/javascript""></script>" & vbCrLf & _
    4. "<script type=""text/javascript"">" & vbCrLf & "//<![CDATA[" & vbCrLf & "function initialize() {" & vbCrLf & "if (GBrowserIsCompatible()) {" & vbCrLf & " // define the crosshair tile layer and its required functions" & vbCrLf & _
    5. "var crossLayer = new GTileLayer(new GCopyrightCollection(""""), 0, 15);" & vbCrLf & "crossLayer.getTileUrl = function(tile, zoom) {" & vbCrLf & " return ""./include/tile_crosshairs.png"";" & vbCrLf & "}" & vbCrLf & _
    6. "crossLayer.isPng = function() {return true;}" & vbCrLf & "" & vbCrLf & "// Create a new map type incorporating the tile layer" & vbCrLf & "var layerTerCross = [ G_PHYSICAL_MAP.getTileLayers()[0]," & vbCrLf & _
    7. "crossLayer ];" & vbCrLf & "var mtTerCross = new GMapType(layerTerCross," & vbCrLf & "G_PHYSICAL_MAP.getProjection(), ""Ter+"");" & vbCrLf & "" & vbCrLf & "var map = new GMap2(document.getElementById(""map_canvas"")," & vbCrLf & _
    8. "{ size: new GSize(DesignedByArquineWidth,DesignedByArquineHeight) } );" & vbCrLf & _
    9. "var directionsPanel = document.getElementById(""route"");" & vbCrLf & _
    10. "var directions = new GDirections(map, directionsPanel);" & vbCrLf & _
    11. "map.addMapType(G_PHYSICAL_MAP);" & vbCrLf & "map.addMapType(mtTerCross);"
    12.  
    13. tt = tt & " var hyd" & m1 & "= new GMarker( new GLatLng (" & CStr(dla3) & "," & CStr(dlon3) & ")" & "," & "markerOptions" & ");" & vbCrLf & _
    14. "GEvent.addListener (hyd" & m1 & "," & " ""mouseover"" " & "," & " function() {" & vbCrLf & _
    15. "hyd" & m1 & " .openInfoWindowHtml (" & """" & d3 & tm & """" & ");" & vbCrLf & _
    16. "});" & vbCrLf & _
    17. "map.addOverlay (hyd" & m1 & ");"
    18.  
    19. tt = tt & "var point1 = [new GLatLng(" & CStr(dla3) & "," & CStr(dlon3) & ")" & "," & "new GLatLng(" & CStr(lat2) & "," & CStr(lon2) & ")];" & vbCrLf & _
    20. "var line = new GPolyline(point1" & "," & """" & hval & """" & "," & 2 & ");" & vbCrLf & _
    21. "directions.load(" & "new GLatLng(" & CStr(dla3) & "," & CStr(dlon3) & ")" & " ," & "new GLatLng(" & CStr(lat2) & "," & CStr(lon2) & ") " & ");"

    Also, this needs to be in the VB6.0 section not the web section.
    Last edited by Nightwalker83; Nov 19th, 2009 at 01:51 AM. Reason: Adding more
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Regarding Map Directions

    Thread Moved
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width