Social Networking :: Google Map API - Get Distance In Miles Instead Of Kilometers (KM)
May 7, 2015
Following the series of question, this is the code as of now has been developed and working fine. Now need to make some more tweek with this
1. Instead of distance from source to destination in KM can we have it in Miles
2. I need to show the distance between source and destinace only if destination falls under 25 mile radius from source else need to show the label message that no record found.
Here is the code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="sqlmap.aspx.cs" Inherits="sqlmap" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
[Code] ....
C# file
-----
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
[Code] ....
View 1 Replies
Similar Messages:
Mar 26, 2016
I used a Google Maps Distance Finder API that comes with two textboxes, one for the source, and one for the destination. It also comes with a button, that when clicked, will find the distance between the two locations using the funciton GetDistance(). The code before the function initializes the map. I created another button and used VB.Net to run SQL code first, and then to automatically populate the two textboxes, then I had it call the function GetDistance().
The issue I ran into is that the function won't calculate the distance, and the map never changes from its default state. I believe it's because it's not running the code that initializes the map. (I could be wrong) I have tried WebBrowser1, to call the click of the button, but I had to Inherit Forms, which I can't do, and I have also tried adding the top code into the GetDistance() function. Is it possible to call the initializing code before GetDistance()?
Here is the JS function code:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>
<script type="text/javascript">
var source, destination;
var directionsDisplay;
var directionsService = new google.maps.DirectionsService();
google.maps.event.addDomListener(window, 'load', function () {
[Code] ....
Here is the VB Code I use to call the JS Function:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim cn As New OleDb.OleDbConnection("Provider = Microsoft.ACE.OleDb.12.0;" & _
"Data Source=|DataDirectory|Address Database One Calculation.mdb")
cn.Open()
Dim cmd1 As OleDb.OleDbCommand
Dim sqlconnection1 As String
[Code] .....
For reference, here is the explanation of the full API Code: [URL] ....
View 1 Replies
Jan 8, 2014
I have variable as
var from_Lati = 19.132324234 // from latitude
var from_longi = 19.11233334 // from longitude
and I have TO latitude and Longitude in Array as
var To_Lati = [18.132323,18.90941,18.31232423] // to latitude in array
var To_Longi = [18.2132123,18.242423,18.43243] // to longitude in array
I have gone through many reference on internet but can't find the solution for calculating the distance with respect to array.. Now I want to find the distance between them using JavaScript...
View 1 Replies
May 7, 2015
I want to create a google maps that it can Calculate Distance, Travel Duration, draw (plot) Route between two locations and display Directions. Now I want to hide Directions Panel.
View 1 Replies
May 7, 2015
Its relate to series of question again. I have datalist bind sql server whcih is fetching 3 address like
Address 1
Address 2
Address 3
After data list I have textbox which is based address like "Based Address"
I have the below script which calculate distance between 2 textboxex.
I want to to calculate the distance between base textbox and address in datalist item so result will like this
Base Address Pune
Datalist address
Address 1 Bombay result distance between pune and bombay 200 Km
Address 1 Kolkota result distance between pune and kolkata 500 Km
//*********DISTANCE AND DURATION**********************//
var service = new google.maps.DistanceMatrixService();
service.getDistanceMatrix({
[Code].....
View 1 Replies
May 7, 2015
I have 2 texbox and button when i type the address on textboxes it generates 2 google map using google map api and it is working fine.
I need to know how can calculate the distance between 2 addresses?
View 1 Replies
Mar 26, 2016
URL....This link shows a demo that let user to put origin and destination then get direction. I want to know how to add a option which is let user to use their current location as origin location (Location from).
View 1 Replies
Oct 6, 2013
I want to use google map , which show the location, address
How to do this....?
View 1 Replies
May 7, 2015
All the facebook, twitter & LinkedIn api are working properly i have integrated this into my project. But still google api code is not findin in your site.
View 1 Replies
Sep 13, 2012
I need to implement google analytics in my asp.net website where I can see all website visits, Bounce Rates, Unique Visitors, Page Views, Country, etc from my website admin panel.
View 1 Replies
Aug 18, 2015
Refer link [URL]..... but when I run page in chrom it show this message...
if I click allow it will show googlemap and if I click deny it doesn't show googlemap...
And in firefox it doesn't show googlemap anymore...
I want it shows google map with out any message in all browser...
View 1 Replies
Jun 16, 2015
I am new in Asp.Net Web development. How to integrate Google Heat Maps into Asp.Net(C#) web application?
View 1 Replies
Nov 13, 2013
Is there any way to install google plugin's in .net. for e.g. if chinese wan't there content should display in there language then it should display on one click
View 1 Replies
May 7, 2015
How to Post message on Google Plus using Asp.net and C#?
View 1 Replies
May 1, 2013
I'm trying to make a web application to create a google route map for a ride. In which I want to map the Marker places as a support station on given route how can I do this.
View 1 Replies
Jun 16, 2015
I'm trying to display a specific location using google maps on my aspx page.
Is there an easy way to do it?
View 1 Replies
May 7, 2015
I want Asp.net example for for One Time OTP using Google Oauth Api.Otp Code send to Mobile.
View 1 Replies
May 7, 2015
I am using Mvc4 application while connecting using google i need to fetch the user details how to do it????
View 1 Replies
Sep 16, 2013
I am implementing google translate in my asp.net through that we can translate our website to 60 more language but when I implement totally my alignment is changing so what to do now?
View 1 Replies
Aug 18, 2015
I want to know about google place autocomplete .....
View 1 Replies
Jul 6, 2013
How to create Google Site Map in asp.net.
View 1 Replies
Aug 17, 2013
We have login any one of the Google Group site. It is not required login to another. Its automatically open requested page.
When I close the one site. another site working. what is the login behind this.
View 1 Replies
Jul 17, 2013
Can u place the code for google login with asp.net application.I have searched the net but no code was clear and cut. Also the logout issue was there.
View 1 Replies
Jun 16, 2015
I want apply google translate my web site
View 1 Replies
May 7, 2015
how to find out zip code searching from address?
View 1 Replies