Jump to content

Search the Community

Showing results for tags 'Google API'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Development
    • HTML Coding
    • JavaScript
    • PHP
    • CMS
    • Database
    • Web Server
    • Web-site Development
    • Internet Marketing, SEO
  • Library
    • Tricks and solutions
    • Books
  • Commercial services
    • Freelance
    • Job
    • Goods and Services
  • Our Forum
    • Flame
    • Contests
    • Feedback and Ideas

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Web site


Telegram


Signal


Viber


Skype


From


Interests

Found 1 result

  1. Привет всем! Такая проблема, как по нажатию кнопки сделать построение маршрута от метро Берестейка к определенному адресу (адрес известен) ?. <button class="route btn btn-primary" id="travelMode1" data-travelmode="WALKING">Пешком</button> <button class="route btn btn-primary" id="travelMode2" data-travelmode="DRIVING">На авто</button> function initialize() { var settings = { zoom: 17, center: new google.maps.LatLng(50.445068, 30.420486), mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU }, navigationControl: true, navigationControlOptions: { style: google.maps.NavigationControlStyle.SMALL }, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), settings); //————————————————— var travelMode; // var travelMode = "google.maps.DirectionsTravelMode.WALKING"; var modeButton1 = document.getElementById('travelMode1'); var modeButton2 = document.getElementById('travelMode2'); modeButton1.onclick = function() { travelMode = "google.maps.DirectionsTravelMode."+this.getAttribute('data-travelmode'); modeButton2.className = ''; this.className = 'active'; setRoutetype (); } modeButton2.onclick = function() { travelMode = "google.maps.DirectionsTravelMode."+this.getAttribute('data-travelmode'); modeButton1.className = ''; this.className = 'active'; setRoutetype (); } //——————————————-- var balloon = new google.maps.InfoWindow(); var service = new google.maps.DirectionsService(); var direction = new google.maps.DirectionsRenderer({map: map}); var position = new google.maps.LatLng(50.448238, 30.491260); var request = { origin: position, destination: latlng, travelMode: travelMode }; var companyImage = new google.maps.MarkerImage('design/images/contacts/pin-jaya.png', new google.maps.Size(154, 133), new google.maps.Point(0, 0), new google.maps.Point(60, 120) ); var companyPos = new google.maps.LatLng(50.448238, 30.491260); var companyMarker = new google.maps.Marker({ position: companyPos, map: map, icon: companyImage, title: "JayaDigital", zIndex: 3 }); function setRoutetype () { navigator.geolocation.getCurrentPosition(function(position) { showRouteService(position); }); } function showRouteService(position) { var request = { origin: new google.maps.LatLng(position.coords.latitude, position.coords.longitude), destination: latlng, travelMode: google.maps.DirectionsTravelMode.DRIVING }; service.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { direction.setDirections(response); } }); } }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy