Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Map Highlight the Path on Drag in the Route

People also ask

Can you highlight a route on Google Maps?

You can trace a path or highlight an area on your map by drawing lines and shapes.

Why isn't Google Maps highlighting my route?

Check that the Location Services toggle is green and in the on position. Tap Google Maps and make sure that Precise Location is turn on. From the same screen, select the While Using the App or Always option.

How do you change the route color on Google Maps?

Open your mymap in edit mode. In the legend, scroll down to where it says: Base Map. Press on the little arrow. That gives you styling options that you can use to take a simple screenshot.


Will this help you?

There were some abilities to Drawing on the Map https://developers.google.com/maps/documentation/javascript/overlays

Maybe this action will help you

There is a section Custom Overlays

https://developers.google.com/maps/documentation/javascript/customoverlays

Which is using OverlayView

The examples you can find here https://developers.google.com/maps/documentation/javascript/customoverlays

Also, there is the second way you can try Simple Polylines https://developers.google.com/maps/documentation/javascript/examples/polyline-simple

Here is the part of example

<script>

      // This example creates a 2-pixel-wide red polyline showing the path of
      // the first trans-Pacific flight between Oakland, CA, and Brisbane,
      // Australia which was made by Charles Kingsford Smith.

      function initMap() {
        var map = new google.maps.Map(document.getElementById('map'), {
          zoom: 3,
          center: {lat: 0, lng: -180},
          mapTypeId: 'terrain'
        });

        var flightPlanCoordinates = [
          {lat: 37.772, lng: -122.214},
          {lat: 21.291, lng: -157.821},
          {lat: -18.142, lng: 178.431},
          {lat: -27.467, lng: 153.027}
        ];
        var flightPath = new google.maps.Polyline({
          path: flightPlanCoordinates,
          geodesic: true,
          strokeColor: '#FF0000',
          strokeOpacity: 1.0,
          strokeWeight: 2
        });

        flightPath.setMap(map);
      }
    </script>