Giter Club home page Giter Club logo

Comments (7)

trasch avatar trasch commented on September 13, 2024

Hm, I never had issues with vanishing paths, and I use them a lot. Can you create a demo project that shows the issue?

from route-me.

mtoon avatar mtoon commented on September 13, 2024

FYI, it actually doesn't seem like a bug because the paths are between points that are far apart (100+ miles) and once you zoom in the associated annotations would be "hidden"... So, the behavior actually makes sense, but I need a way to show paths between two waypoints that are far apart at high zoom levels. So, any thoughts on how to create a static path between two points would be great!
Thanks!
p.s. I can whip up a working demo to try and flesh this functionality out if need be.

from route-me.

trasch avatar trasch commented on September 13, 2024

A small demo would be great, so that I have something to play with. Since our products are fairly complicated and use most of the route-me functionality, I might know some not-so-obvious solution to this problem.

from route-me.

trasch avatar trasch commented on September 13, 2024

BTW if you want an annotation to never be hidden, then you could also set the whole world as the bounding box for the annotation:

- (void)setBoundingBoxCoordinatesSouthWest:(CLLocationCoordinate2D)southWest northEast:(CLLocationCoordinate2D)northEast

from route-me.

mtoon avatar mtoon commented on September 13, 2024

Sounds good. I'll work on a demo later today and get it up. Also, your bounding box suggestion might be a perfect solution. I'm guessing if I drew a path between two far points and set the bounding box to be each point that would probably solve my disappearing route problem?

from route-me.

trasch avatar trasch commented on September 13, 2024

Ah, now I see your problem. This is actually badly documented, I have to admit. You have to set the path bounding box for the annotation and the map view will do the rest. In my code, it looks like this (in a RMMapView category):

- (void)addPolyline:(NSArray *)linePoints withLineColor:(UIColor *)lineColor
{
    if ([linePoints count] < 2) return;

    linePoints = [GeoUtils reduceNumberOfCoordinates:linePoints to:900];

    RMAnnotation *polylineAnnotation = [RMAnnotation annotationWithMapView:self coordinate:((CLLocation *)[linePoints firstObject]).coordinate andTitle:nil];
    polylineAnnotation.annotationType = @"polyline";
    polylineAnnotation.userInfo = [NSDictionary dictionaryWithObjectsAndKeys:linePoints,@"linePoints", lineColor,@"lineColor", nil];
    [polylineAnnotation setBoundingBoxFromLocations:linePoints];

    [self addAnnotation:polylineAnnotation];
}

linePoints is an array of CLLocations. So, setting the bounding box to the two endpoints should do the trick.

I think I should make this more evident...

from route-me.

mtoon avatar mtoon commented on September 13, 2024

Setting the bounding box worked perfectly, thank you! I'm going to try and implement the rest of the various items using annotations and see how that plays out before trying to implement static layers.

Thanks again!

from route-me.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.