|
-
Nov 19th, 2009, 01:32 AM
#1
Thread Starter
Lively Member
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&v=2.x&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
-
Nov 19th, 2009, 01:47 AM
#2
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:
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&v=2.x&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) & ") " & ");"
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
-
Nov 19th, 2009, 05:30 AM
#3
Re: Regarding Map Directions
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|