请帮助我们,我有点卡住........ [英] pls help me guys i'm stuck bit........

查看:88
本文介绍了请帮助我们,我有点卡住........的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,



是否有任何方法可以在c#中使用起始位置和结束位置获取谷歌方向或者..启动纬度,经度和结束纬度,经度..



到目前为止我的编码是这样的,但我还需要一些零件来获取路线



Guys,

is there any way to get google direction in c# only using start location and end location or.. start lattitude, longitude and end lattitude, longitude ..

up to now i coded like this but i need some more parts to get directions

string geoDirect1 = string.Format(@"http://maps.google.com/maps/api/directions/xml?origin={0}&destination={1}&sensor=false", Strt_Address, End_Address);

//send my strt address and end address to api.


XmlDocument geoDirectXmlDoc = new XmlDocument();
        geoDirectXmlDoc.Load(geoDirect1);

//load it using xmldocument....





我迷路了。告诉别人接下来要做什么?



I'm lost.Tell me someone what i want to do next?

推荐答案

这个Java脚本应该有所帮助:





This Java Script should help:


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

  <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="style.css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <style>
    body {
        color: black;
        font-family: arial,sans-serif;
        font-size: 13px;
    }
    </style>
    <script type="text/javascript">
        var map;
        var directionsDisplay;
        var directionsService = new google.maps.DirectionsService();


document )。ready( function (){

// 以Empire State Building Newyork为中心绘制地图
var latlng = new google.maps.LatLng( 40 748492 , - 73。 985496 );
var myOptions = {
zoom: 15
center:latlng,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
map = new google.maps。 Map document .getElementById( map_canvas),myOptions);

directionsDisplay = new google.maps.DirectionsRenderer();
directionsDisplay.setMap(map);
// directionsDisplay.setPanel(document.getElementById(divDirections));
(document).ready(function () { //draw a map centered at Empire State Building Newyork var latlng = new google.maps.LatLng(40.748492, -73.985496); var myOptions = { zoom: 15, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); directionsDisplay = new google.maps.DirectionsRenderer(); directionsDisplay.setMap(map); //directionsDisplay.setPanel(document.getElementById("divDirections"));


#btnGetDirections)。click( function (){
calcRoute(
("#btnGetDirections").click(function () { calcRoute(


这篇关于请帮助我们,我有点卡住........的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆