polyline

Draw a line between two markers map-box react-native?

六眼飞鱼酱① 提交于 2019-12-05 10:20:12
I was able to achieve creating a marker (annotation) on the map using the below code in react-native . import React, { Component } from 'react'; import { Platform, StyleSheet, Text, View } from 'react-native'; import MapboxGL from '@mapbox/react-native-mapbox-gl'; import Mapbox from '@mapbox/react-native-mapbox-gl'; const columbusCircleCoordinates = [ -73.98197650909422, 40.768793007758816 ]; Mapbox.setAccessToken('your access key'); export default class App extends Component { renderAnnotations () { return ( <Mapbox.PointAnnotation key='pointAnnotation' id='pointAnnotation' coordinate={[11

Smoothing GPS tracked route-coordinates

筅森魡賤 提交于 2019-12-05 02:31:54
问题 I have some data of coordinates that I recorded. Unfortunatelly they seem to be not realy good. They jump sometimes over the map. So now I´m searching for some flattening or filtering algorithm that would make the route look more realistic. Currently my only filter is to calculate the max possible meters travelled in a second (in bus or car or walking) and compare them with the coordinates, throwing those away, that are just not possible within a timeframe. So if a person can walk up to 2.5

Detect tap on GMSPolyline in Swift?

眉间皱痕 提交于 2019-12-05 01:13:08
I'm struggling with detecting a tap on a GMSPolyline drawn on my Google map, it works just fine with GMSpolygones, but the same approach doesn't seem to work with polyline. My current approach, which works for polygones, is: if (GMSGeometryContainsLocation(coordinate, polygon.path!, false)) { ... } Any suggestions how to detect taps on a polyline? Or just close to it? eshirima According to their API documentation , GMSPolyline inherits from GMSOverlay which means a GMSPolyline has the property tappable . So you'd want something like this let polyLine: GMSPolyline = GMSPolyline(path: newPath)

Android Polyline - Adding point by point

ぐ巨炮叔叔 提交于 2019-12-04 20:07:46
问题 I'm currently having a map, and each 10 meters I use LocationListener to refresh my location and get the new Latitude and Longitude. Now I wish that the route the user is taking will be displayed with a red line. So everytime the OnLocationChange() from LocationListener class is called, I want to update the map with a line between the last location and the new location. So far I've added the following: private void initializeDraw() { lineOptions = new PolylineOptions().width(5).color(Color

Avoiding vertex drag maps api v3

怎甘沉沦 提交于 2019-12-04 18:45:35
Very simple. I want to avoid the dragging of the first and last vertices. I've tried using dragstart event, but apparently polyline doesn't listen to that one. I've managed to do something with set_at. I have the last position stored, when set_at is called, I check the index of that vertex, and then set the latLng for that vertex to the old one. This was only possible using setAt function which fires the event again. So a created a ignoreNextEvent flag, so It won't go for an infinite loop. problem is, setAt function os used plenty of times by the maps api, and the solution, although works, is

Leaflet - draw polyline vertices only

假如想象 提交于 2019-12-04 17:38:17
The title is quite clear, I'm using Leaflet and I need to show only the vertices of a polyline. For exemple see this image : Currently I can only have the black line, I'd like only the red squares. Using markers is not an option for performance issue, my lines can be huge (500 000 vertices) and the use of smoothFactor is a need. Is that possible? If not, does someone knows a plugin that does that, or have a hint on how could I do that by extending the Polyline class? What you could do here is every time the polyline gets rendered, get the segments of it's SVG path, use those points to add SVG

How to distinguish two MKPolyline's in viewForOverlay:

我怕爱的太早我们不能终老 提交于 2019-12-04 14:34:51
I am loading multiple MKPolylines as overlays onto an MKMapView . I would like to be able to distinguish these some how so change things like color, line width, etc. But, when viewForOverlay: gets called, it sees all my MKPolylines the same, which doesn't allow me to change any of them. - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay { if ([overlay isKindOfClass:[MKPolyline class]]) { MKPolylineView *aView = [[[MKPolylineView alloc] initWithPolyline:(MKPolyline*)overlay] autorelease]; aView.strokeColor = [[UIColor blueColor] colorWithAlphaComponent:0.7];

zoom over specific route google map

こ雲淡風輕ζ 提交于 2019-12-04 10:15:39
问题 I have a list of random latitude and longitude points and I am drawing a route between them. My question is how to bound this route within google map I made below utility method public static void drawRouteIntoMap(final List<? extends MapHelper> position, final GoogleMap googleMap) { /*List<MapHelper> position = new ArrayList<MapHelper>(); for (int i = lastPosition; i < maps.size(); i++) { position.add(maps.get(i)); }*/ if (position.size() > 0 && Validator.isNotNull(googleMap)) { googleMap

Multiple polylines and infowindows with Google Maps V3

主宰稳场 提交于 2019-12-04 08:42:40
问题 I have a map with multiple polylines and would like to open a line-specific-infowindow when clicking the line. So far my code only shows the content of the last iteration. I found two very nice examples of what I want but after hours of trying I am still no further. Example 1: http://srsz750.appspot.com/api3/polylines-multiple.html Example 2: http://www.geocodezip.com/v3_GenericMapBrowser.asp?filename=flights090414.xml So your are my last shot :-S Here is my code that shows only the content