Here maps: onclick add Curved line between two points using Here maps?

Published

Here Added code for on click draw polyline between 2 points. Need to help how we can add curve/arc line between two geo location.

          // add map
          var defaultLayers = this.platform.createDefaultLayers();
          var map = new H.Map(document.getElementById('map'),
            defaultLayers.vector.normal.map,{
               center: {lat:21, lng:72},
               zoom: 7,
               pixelRatio: window.devicePixelRatio || 1
            });
            var lineString = new H.geo.LineString();
            const mapevents = new H.mapevents.MapEvents(map);

            // enable the tap event system
            this.map.addEventListener("tap", (event: any) => {
              const position = map.screenToGeo(event.currentPointer.viewportX, 
              event.currentPointer.viewportY);
              const marker = new H.map.Marker(position);
               map.addObject(marker);

              //push point to strip
              lineString.pushPoint(position);
              console.log(this.lineString);

              //create the line
              map.addObject(new H.map.Polyline(
                lineString, { style: { lineWidth: 4 }}
              ));
            })```

Source: Angular Questions

Published
Categorized as angular, heremaps, javascript, typescript Tagged , , ,

Answers

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq