Closed saravananNV closed 8 years ago
IMO it should "just work", maybe put together a dummy project that shows the issue? Do look through the demo code in this repo that definitely works correctly with a pin annotation.
Ofcourse, I have seen the demo project and use the code form the file NAPinAnnotationsDemoViewController which was used to create pin..the only difference was i converted into swift..but my effort was in vain. i have attached the sample project here.i working around with two days..but i dont get any lead.
Thankyou
@saravananNV Instead of a zip, maybe put your project on Github, open an issue and link from here. Me or someone else will take a look when we get a chance. Maybe you'll get a PR with a fix ;)
@dblock ..thank u..here is the git hub link of the project
https://github.com/saravananNV/NaMapkit
Thanks Guys,
could be because the pin assets are inside a separate bundle now, and they may have been using UIImage imageNamed:
Hi Orta, I have given my git hub project link above which use NAMapkit frame work. can you please see that and tell me where i am wrong.
Help will be appreciated
Thanks Guys
I put a breakpoint in the loading of the image in https://github.com/neilang/NAMapKit/blob/master/NAMapKit/NAPinAnnotationView.m#L56, and that's exactly the problem, the image isn't loaded from the bundle.
UIImage *pinImage = [UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] bundlePath] stringByAppendingString:pinImageName]];
[self setImage:pinImage forState:UIControlStateNormal];
This ends up being something like "/Users/dblock/Library/Developer/CoreSimulator/Devices/6171C10F-67C0-471D-B74B-7E4149ACDF69/data/Containers/Bundle/Application/A14D79BC-8942-407D-B9B3-C6D4E2D24639/sample.app/pin_purple.png" which is incorrect, it's missing "Frameworks/NAMapKit.framework" in the path.
@orta Do you know the right way to fix this?
[NSBundle mainBundle] bundlePath]
wants to changes for [NSBundle mainBundle] bundleForClass:NAMapKit.class]
@saravananNV Want to try to fix this in this project and submit a pull request?
Is there is any way to fix this bug?.. or you guys working on it.i have to use this wonderful mapkit in our project with in two days.thats y , i am trying it to work on pinAnnotation with this sample app for a trial..
Thanks
Fix the bug by changing the code in NAMapKit as orta suggests above. Submit a pull request with the fix after you've tested it.
when i try to change that particular line.it shows the below error:
No visible @interface for 'NSBundle' declares the selector 'bundleForClass:'
I cant use bundleforclass. for my version i can use only bundlepath,bundleurl and bundleIdentifier
HI Orta & dblock
hey, guys i fxed it....i modified the line on https://github.com/neilang/NAMapKit/blob/master/NAMapKit/NAPinAnnotationView.m#L56 by
NSString * image = _animating ? [NSString stringWithFormat:@"%@Floating", pinImageName] : pinImageName; [self setImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
which is from https://github.com/nicked/NAMapKit/blob/master/NAMapKit/NAPinAnnotationView.m line 58
@saravananNV - I'm afraid I don't have the time to hold your hand through using this library.
@orta , you and @dblock have spend your valuable time with me. all my issues are fixed..last task was how can i change images for pin annotation.just give me a lead.then i will work on it.sorry to disturb u @orta
thanks
I think if you want to change the images you might want to either subclass the annotation class or roll out your own.
Would appreciate a pull request with your fix, please @saravananNV.
@dblock and @orta there is no image porperty on Annotation class.then how can i change the image instead of pin
@dblock and @orta i have created a custom class which inherits the annotation and override the function createviewonmapview.but how to integrate this function which explicit my new view and also how to set image for customized pin. i know that i am troubling you too. i am stuck.thats y..please help me
thanks,
@saran-metron and @saravananNV - you're not getting much help here because you're asking for fairly basic things, and I totally understand that you're just starting programming in Objective-C, but people contributing to this project don't really have time to teach you the basics. I suggest finding a friend or colleague who's a bit more experienced and pairing with them on this. I am sorry I cannot be of much more help - when/if I have time I'll write up some more examples.
This was my code i have an image named floor_map as local image
I am very new to IOS The pinannotation was not working but dotannotation was working perfect with same x and y co-ordinates.May be i dont know how to use this for pin annotation and also i want to show an image which replace the pin.can some one please help me.i am stuck