hansemannn / titanium-googlemaps

🗺 Use the Google Maps SDK in Titanium
Other
87 stars 26 forks source link

Added anchorPoint and rotation to Marker #6

Closed yozef closed 8 years ago

hansemannn commented 8 years ago

Hi @yozef, thank you for the PR! I left a few comments (mostly regarding unrelated files). To make PR's easier in the future, I will add a .gitignore now to handle user-specific files automatically. Thanks!

yozef commented 8 years ago

hehehe I figured I committed way too many files for such small changes. My current module has more features implemented however, the latest GoogleMaps.bundle is over 100 mb. I'll figure out a way.

hansemannn commented 8 years ago

Alright. The .gitignore was just pushed, so removing the builds in one commit should be future-save now. Any feature-requests are welcome!

yozef commented 8 years ago

I'll be cleaning up more my code soon. I'm adding some of the animations (animateToLocation, animateToZoom, etc;). I'll be using this module heavily so might as well give back to the community and thanks to you we have a great head start :)

hansemannn commented 8 years ago

Appreciate that. Will add the infoWindowAnchor property now and release the 2.1.0 after your changes can be merged.

yozef commented 8 years ago

Great!

yozef commented 8 years ago

Hi @hansemannn I've modified the files mentioned above. I've also added bearing and viewingAngle to setCamera, as well as the event trigger mapViewDidFinishTileRendering by listening to the complete event from Ti.

I will close this pull request in favor of the next one (which will be 2.1.0).

However before I commit, I wanted to add some methods of GoogleMaps, such as animateToLocation, and I think I'm doing something wrong, as it's not properly calling that method from Ti. Here is what I've done: In TiGooglemapsMapViewProxy.m, I added:

-(void) animateToLocation:(id)args {
    ENSURE_UI_THREAD_1_ARG(args);
    ENSURE_TYPE(args, NSDictionary);

    id latitude = [args valueForKey:@"latitude"];
    id longitude = [args valueForKey:@"longitude"];

    ENSURE_TYPE(latitude, NSNumber);
    ENSURE_TYPE(longitude, NSNumber);

    [[[self mapView] mapView] animateToLocation:CLLocationCoordinate2DMake([TiUtils doubleValue:latitude], [TiUtils doubleValue:longitude])];
}

I think I'm not referencing mapView correctly with [[self mapView] mapView]

and in TiGooglemapsMapViewProxy.h, I added: -(void)animateToLocation:(id)args;

When I try to call from Ti this:

mapView.animateToLocation({
    latitude: 45.641959,
        longitude: -73.130588
});

Nothing happens (as in the Map dosent' animate to the specified longitude/latitude). I feel I'm missing something.

hansemannn commented 8 years ago

@yozef I will take a look today.

yozef commented 8 years ago

I'm starting to be convinced that referencing the mapView in

[[[self mapView] mapView] animateToLocation:CLLocationCoordinate2DMake([TiUtils doubleValue:latitude], [TiUtils doubleValue:longitude])];

is whats causing the issue.

hansemannn commented 8 years ago

That looks fine. [self mapView] is the reference to the proxy view, the [[self mapView] mapView] references the GMSMapView inside the proxy view. Please try to use ENSURE_UI_THREAD(animateToLocation, args) to ensure it runs on the correct thread. This PR also has merge conflicts, so you might open another one to clean this up.

yozef commented 8 years ago

I found the issue, I was missing a silly mistake id location = [args objectAtIndex:0]; Thanks!

for the new PR, the updated GoogleMaps framework is over 100 mb, and github is complaining that it's too large to commit. Maybe I could remove the framework from it's folder (and then other devs who wish to download it can do so and place it back in there)? Not sure if there are other solutions to by pass this limitation?