Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Renderer-API, support Indoor-Navigation API #99

Merged
merged 15 commits into from
Jul 28, 2017
Merged

Conversation

hansemannn
Copy link
Owner

@hansemannn hansemannn commented Jul 13, 2017

@hansemannn hansemannn added this to the v3.8.0 milestone Jul 13, 2017
@hansemannn hansemannn changed the title Add map-renderer Add "renderFromFile" method Jul 13, 2017
@hansemannn hansemannn self-assigned this Jul 14, 2017
@hansemannn hansemannn changed the title Add "renderFromFile" method Add Renderer-API Jul 14, 2017
@hansemannn hansemannn changed the title Add Renderer-API Support Renderer-API, support Indoor-Navigation API Jul 15, 2017
@hansemannn
Copy link
Owner Author

@yozef wanna review? 👀 😃

@yozef
Copy link
Collaborator

yozef commented Jul 15, 2017

Sure :)

@yozef
Copy link
Collaborator

yozef commented Jul 15, 2017

Having crashes when I use:

// Testing 3.8.0
$.mapview.indoorPicker = true;
$.mapview.indoorEnabled = true;
	
$.mapview.indoorDisplay.addEventListener('didChangeActiveBuilding', function(e) {
	Ti.API.info('didChangeActiveBuilding ' + JSON.stringify(e));
});
$.mapview.indoorDisplay.addEventListener('didChangeActiveLevel', function(e) {
	Ti.API.info('didChangeActiveLevel ' + JSON.stringify(e));
});

When I zoom into an area where I know has indoor location, zooming in enough just when the events are about to fire, I get this uncaught exception:

[ERROR] :  The application has crashed with an uncaught exception 'NSInvalidArgumentException'.
[ERROR] :  Reason:
[ERROR] :  -[TiGooglemapsIndoorLevelProxy copyWithZone:]: unrecognized selector sent to instance 0x7fb34c755a80
[ERROR] :  Stack trace: ...

@yozef
Copy link
Collaborator

yozef commented Jul 15, 2017

Testing out the KML renderer:

// Render KML
var renderer = $.mapview.createRenderer({
    file: 'KML_Samples.kml',  // added this .kml into assets/
    mapView: $.mapview
});
renderer.render();

I get this error:
[ERROR] : message = "undefined is not a function (evaluating '$.mapview.createRenderer({\n file: \"KML_Samples.kml\",\n mapView: $.mapview\n })')";

It seems that this might be on my end? maybe wrong API implementation (I used the same code syntax from the readme).

Using this KML: https://developers.google.com/kml/documentation/KML_Samples.kml

@hansemannn hansemannn requested a review from yozef July 15, 2017 16:21
@hansemannn
Copy link
Owner Author

Re indoor-picker: The floor name / floor short-name can be null, I added the guards now.
Re renderer: The renderer is created from the module-instance, not the map-view instance. It shouldn't crash then.

@yozef
Copy link
Collaborator

yozef commented Jul 16, 2017

Re-tested indoor events with the new committed code (got the same result as before):
Crashes when I use:

// Testing 3.8.0
$.mapview.indoorPicker = true;
$.mapview.indoorEnabled = true;
	
$.mapview.indoorDisplay.addEventListener('didChangeActiveBuilding', function(e) {
	Ti.API.info('didChangeActiveBuilding ' + JSON.stringify(e));
});
$.mapview.indoorDisplay.addEventListener('didChangeActiveLevel', function(e) {
	Ti.API.info('didChangeActiveLevel ' + JSON.stringify(e));
});

When I zoom into an area where I know has indoor location, zooming in enough just when the events are about to fire, I get this uncaught exception:

[ERROR] :  The application has crashed with an uncaught exception 'NSInvalidArgumentException'.
[ERROR] :  Reason:
[ERROR] :  -[TiGooglemapsIndoorLevelProxy copyWithZone:]: unrecognized selector sent to instance 0x7faf3c4ca540
[ERROR] :  Stack trace:
[ERROR] :  0   CoreFoundation                      0x000000010b450af3 __exceptionPreprocess + 147
[ERROR] :  1   libobjc.A.dylib                     0x0000000105f0e141 objc_exception_throw + 48
[ERROR] :  2   CoreFoundation                      0x000000010b4c0134 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
[ERROR] :  3   CoreFoundation                      0x000000010b3d7840 ___forwarding___ + 1024
[ERROR] :  4   CoreFoundation                      0x000000010b3d73b8 _CF_forwarding_prep_0 + 120
[ERROR] :  5   MyApp                              0x00000001034801f0 TiBindingEventCreateWithNSObjects + 144
[ERROR] :  6   MyApp                              0x00000001032f9358 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 120
[ERROR] :  7   MyApp                              0x00000001032f8fdb -[TiProxy fireEvent:withObject:] + 139
[ERROR] :  8   MyApp                              0x0000000103ae760e -[TiGooglemapsIndoorDisplayProxy didChangeActiveLevel:] + 152
[ERROR] :  9   CoreFoundation                      0x000000010b3d8c6c __invoking___ + 140
[ERROR] :  10  CoreFoundation                      0x000000010b3d8b40 -[NSInvocation invoke] + 320
[ERROR] :  11  CoreFoundation                      0x000000010b3f0956 -[NSInvocation invokeWithTarget:] + 54
[ERROR] :  12  MyApp                              0x000000010354b6ce -[GMSDelegateForward forwardInvocation:] + 102
[ERROR] :  13  CoreFoundation                      0x000000010b3d7656 ___forwarding___ + 534
[ERROR] :  14  CoreFoundation                      0x000000010b3d73b8 _CF_forwarding_prep_0 + 120
[ERROR] :  15  MyApp                              0x000000010354bd6c -[GMSIndoorDisplay updateFocusedBuilding:activeLevel:indoorState:] + 259
[ERROR] :  16  MyApp                              0x00000001034bd0fc -[GMSMapView vectorMapView:didUpdateFocusedBuilding:fromBuilding:activeLevel:] + 127
[ERROR] :  17  MyApp                              0x000000010362fa7e -[GMSVectorMapView didUpdateFocusedBuilding:fromBuilding:activeLevel:] + 124
[ERROR] :  18  MyApp                              0x000000010369bed1 __44-[GMSIndoorFocusManager setFocusedBuilding:]_block_invoke + 57
[ERROR] :  19  libdispatch.dylib                   0x000000010cffb585 _dispatch_call_block_and_release + 12
[ERROR] :  20  libdispatch.dylib                   0x000000010d01c792 _dispatch_client_callout + 8
[ERROR] :  21  libdispatch.dylib                   0x000000010d004247 _dispatch_main_queue_callback_4CF + 1041
[ERROR] :  22  CoreFoundation                      0x000000010b415909 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
[ERROR] :  23  CoreFoundation                      0x000000010b3dbae4 __CFRunLoopRun + 2164
[ERROR] :  24  CoreFoundation                      0x000000010b3db016 CFRunLoopRunSpecific + 406
[ERROR] :  25  GraphicsServices                    0x000000010e4baa24 GSEventRunModal + 62
[ERROR] :  26  UIKit                               0x0000000107f1b134 UIApplicationMain + 159
[ERROR] :  27  MyApp                              0x0000000103213fc4 main + 100
[ERROR] :  28  libdyld.dylib                       0x000000010d06565d start + 1
[ERROR] :  29  ???                                 0x0000000000000001 0x0 + 1
-- End simulator log ---------------------------------------------------------

You can check at SFO airport Terminal 2: 37.617174, -122.383633 zoom in enough I got the results above.

@yozef
Copy link
Collaborator

yozef commented Jul 16, 2017

KML renderer worked :)
I figured my code was the culprit before.

2017-07-16 at 10 09 39 am

2017-07-16 at 10 20 10 am

@mcongrove
Copy link

KML renderer definitely works; quite well, too! Thanks Hans.

@mcongrove
Copy link

The mapStyle no longer functions as it did before (tried passing JSON string, as well as new file location option). Get the following error: Could not apply map style: The data couldn't be read because it isn't in the correct format. Worked prior to this PR.

Sample styling JSON attached, generated from Google's style generator.

map_style.json.txt

@yozef
Copy link
Collaborator

yozef commented Jul 17, 2017

@mcongrove hmmm style json is working for me. Not sure it's visible, but the KML snapshots posted have a json style rendered.

@mcongrove
Copy link

mcongrove commented Jul 17, 2017

@yozef Strange. I went back to before 06e3d4d and my style JSON works. Any newer commit and it breaks for me. Sanity check me by trying my JSON file?

@yozef
Copy link
Collaborator

yozef commented Jul 17, 2017

@mcongrove this requires a different issue to be opened, as the indoor events are still buggy.

For the mapStyle:

var mapJSONStyle = [ { "elementType": "geometry", "stylers": [ { "color": "#ebe3cd" } ] } ..... ]; // Array Obj
$.mapview.mapStyle = JSON.stringify(mapJSONStyle);

@hansemannn
Copy link
Owner Author

@mcongrove I changed the mapStyle to detect both JSON-strings and file-references. If it's a JSON-file, it needs to end with ".json", if it's any other string, it will be passed to the module.

@mcongrove
Copy link

@hansemannn It does end in ".json"; GitHub just doesn't allow that file extension for uploads, so I used ".txt". Sorry, should've clarified that.

@hansemannn
Copy link
Owner Author

Can you try the latest commit? I forgot commiting yesterday :-)

@mcongrove
Copy link

I'm confused. Looks like the only changes since the last version I tested is to the README. What are you wanting me to re-test?

@hansemannn
Copy link
Owner Author

@mcongrove Dump issue, fixed it.

@hansemannn
Copy link
Owner Author

@yozef Working on the indoor-level issue, it's related to the GoogleMaps SDK not being thread-safe again :(

@hansemannn
Copy link
Owner Author

hansemannn commented Jul 26, 2017

I've created a ticket at Google for this, since I'm kind of running out of ideas here, what the SDK could do wrong. Maybe we exclude that event for now and mark it as a future support? Would be bad to block all the other features here because of that one.

@hansemannn
Copy link
Owner Author

Fixed it.....Let's get this in @yozef 😅

@yozef
Copy link
Collaborator

yozef commented Jul 26, 2017 via email

@hansemannn hansemannn merged commit d333beb into master Jul 28, 2017
@hansemannn hansemannn deleted the add-renderer branch October 26, 2017 16:56
hansemannn added a commit that referenced this pull request Nov 12, 2020
Support Renderer-API, support Indoor-Navigation API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants