oomph / macmapkit Goto Github PK
View Code? Open in Web Editor NEWMapKit Framework for the Mac
License: BSD 3-Clause "New" or "Revised" License
MapKit Framework for the Mac
License: BSD 3-Clause "New" or "Revised" License
Hi there,
I encountered an issue I'm unable to fix...
I'd like to have the line width of an MKPolylineView to scale according to the map zoom.
So the larger I zoom the map the thicker the line should get.
Example: I have a track between 2 CLLocations which is 11m long. I want to set the width of this track to 11m and draw this track on the map.
Now this track should be shown as a kind of a square, since its width is as big as its length.
When I'm zooming the lines length will grow and the line width should grow, too.
But it doesn't.
How am I able to implement this behaviour?
Since there is no -(void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context as mentioned in the documentation for MKMapKit I have no clue how to handle this.
(please take issue #19 for reference)
Hi,
Is it possible to get the retina images working. I added an @2x version of the image to the project. But when I'm on my retina Mac I always get the annotations with double the size....
Any idea how I can fix this?
Hi
I've integrated your MapKit in one of my projects, I did all the steps. But there is a problem.
Here I'm using a NSToolbar and switching between the views. whenever I'm in my map page if I switch in another page and then switch back to the map page, the map is drew under the MKMapView and MKMapView is white but I can navigate in map by dragging mouse in the white area.
Regards
I've integrated MacMapKit into my app and I'm finding that my MKMapView is updating the map even if the map isn't visible and in fact never has been (window is closed). In fact, it is updating even before I've even started asking for location information.
Is this expected behavior and if so, how do I prevent it?
For testing purposes I set the center coordinate to something specific but the map wasn't centered in MapView.
Testcode: (realWorldMapView is an Outlet, connected to an MKMapView in Interface Builder)
- (void) awakeFromNib
{
NSLog(@"I'm wake...");
NSLog(@"Center: %f,%f", [[self realWorldMapView] centerCoordinate].latitude, [[self realWorldMapView] centerCoordinate].longitude);
CLLocationCoordinate2D testCoordinate = CLLocationCoordinate2DMake(53.54960047481663, 9.999395758354169);
NSLog(@"Center: %f,%f", testCoordinate.latitude, testCoordinate.longitude);
[[self realWorldMapView] setCenterCoordinate:testCoordinate animated:YES];
[[self realWorldMapView] setMapType:MKMapTypeHybrid];
NSLog(@"Center: %f,%f", [[self realWorldMapView] centerCoordinate].latitude, [[self realWorldMapView] centerCoordinate].longitude);
}
The output is:
2012-04-19 13:49:04.312 iGUAdministrator[846:503] I'm wake...
2012-04-19 13:49:04.314 iGUAdministrator[846:503] Center: 0.000000,0.000000
2012-04-19 13:49:04.314 iGUAdministrator[846:503] Center: 53.549600,9.999396
2012-04-19 13:49:04.314 iGUAdministrator[846:503] Center: 0.000000,0.000000
So obviously something didn't work.
realWorldMapView points to the real thing since the mapType is set.
First of all, great map kit for mac!
I'm working on an app that I wish to publish in Mac App Store. For using using OS X older than 10.9, I want to integrate your framework inside my app. And I wonder is there any chances the app using be rejected by Apple because of this framework? (For example, does this MapKit use any inner APIs? Or simply Apple doesn't like any other MapKit?)
Thanks!
when i search a locate use showAddress: and i want to locate a pin in the centre of the map by taking the value of MKMap's centerCoordinate, but the longitude is -255, it's a critical bug
If -[MKMapView addAnnotation:] is called before -[MKMapViewDelegate mapViewWillStartLoadingMap:] it fails with the following message: "Error creating internal representation of annotation view for annotation: <MKPointAnnotation: 0x7fc514969060> <0.000000, 0.000000> Pin Title - (null)".
Also, -[MKMapView setCenterCoordinate:] seems to have no effect until after -[MKMapViewDelegate mapViewWillStartLoadingMap:].
This is not consistent with MKMapView on iOS. I'd assume that the root cause is related to the web view not having loaded properly before -[MKMapViewDelegate mapViewWillStartLoadingMap:], but I have not investigated it further as it is fairly easy to work around.
Hi,
I'm trying to implement overlays in my Mac application, but when I add an overlay I always get the "Error creating internal representation of overlay view for overlay: <MKPolyline: 0x1004c55e0>" error...
Do you have any idea what it means? Or how I can solve this?
Thanks a lot, great framework port by the way!!
Hi,
I found a bug in the instance method of the MKMapView class:
It doesn't work when animated is set to "YES":
[mapView setRegion:coordinateRegion animated:YES];
Has anyone seen this before? It works fine when selected "NO":
[mapView setRegion:coordinateRegion animated:NO]
Is there any way to enable zoom with animation? Can it be fixed please?
Cheers,
Valik
I retrieve the user's location using CLLocationManager.
Here's the code where I add a new annonation (CLLocationManager delegate method):
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{
[locationManager stopUpdatingLocation];
CLLocationCoordinate2D coord = {.latitude = newLocation.coordinate.latitude, .longitude = newLocation.coordinate.longitude};
MKPointAnnotation *pin = [[MKPointAnnotation alloc] init];
pin.title = @"Hi.";
pin.coordinate = coord;
[_mapView addAnnotation:pin];
}
This is the output in my console:
Wasn't able to create a MKAnnotationView for annotation: <MKPointAnnotation: 0x10ad67710> <(latitude value), (longitude value)> Hi. - (null)
Any ideas? Thanks!
When dragging an annotation around, when you finish dragging the MKAnnotationViewDragStateEnding state is supposed to be sent, but never is. I am currently getting around this by checking if oldState was dragging and newState is none, but this isn't the best solution and MKAnnotationViewDragStateEnding should really be sent.
the mavericks sdk has added it's own mapkit. Unfortunately it's only available for apps that are sold through the app store. I'd love to still be able to use this version of map kit for my non-appstore app. It looks like it would probably just need to be recompiled with a different framework name so it wouldn't conflict with the official api's symbols.
Are there any plans to add this in the future?
is there a way to disable a pin from being dragged?
I think this broke on for Mac 10.7.3 or perhaps a recent google maps update, but clicking on pins no longer works. It was working fine and then one day it stopped. I checked, and MapKitView::addAnnotation is being called and working still. But, didSelectAnnotationView isn't being called.
I'm new to github. Please forgive me if I'm missing info or not following protocol.
method doesn't work for type 3 - which should be Terrain map. I really don't know if it is MapKit issue or Google API change...
Hi,
how can I zoom to display all my annotation/whole polygon - I'm missing [mapView regionThatFits] method. Is there any other way to do it?
Thanks for answer.
M.
Hi,
I encountered a problem in the MacMapKit MKOverlayView.
According to the Apple Documentation one can override
-(void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context
and draw an image or something like that on the overlay.
I'd love to implement this feature in my own app, but I'm unable to since this method seems not to be called at all.
Apple Example Application:
http://developer.apple.com/library/ios/#samplecode/HazardMap/Listings/Classes_HazardMapView_m.html#//apple_ref/doc/uid/DTS40010049-Classes_HazardMapView_m-DontLinkElementID_8
How to add MKPolyline Overlay in Map
when i add a tips view(custom NSView) on the MKMap, it always ok except i used the showsUserLocation, the tips view is disappear when locate myself;
[mapView setRegion:routeRegion animated:YES] scrolls/zooms the map to a different view to that when using animated:NO in the same function.
It looks like the centre point of the map is moved to the middle of the lower (southern) edge of the map with animate:YES is used. When animate:NO is used, the map is drawn as expected.
I've modified the Demo app in MacMapKit to illustrate this - download from: http://www.yellowfield.co.uk/macmapkit/MacMapKit-Animate_Issue.zip
On the main screen there's two additional buttons, one each for animate:YES and animate:NO. Clicking each button illustrates the problem.
Hi there, sometimes I get the following error combined with an EXC_BAD_INSTRUCTIONS:
"objc[3122]: cannot form weak reference to instance (0x101849790) of class MapViewController"
It is kinda hard to reproduce but seems to be located in the ARC of my project.
(Since non-arc should'n support weak references after all.)
MapViewController is registered as the delegate of MKMapView and sometimes this issue happens when I'm manipulating the selected annotations.
-- snip --
Some sample code causing this issue - sometimes. And working fine the other times.
[mapView selectAnnotation:[_managedPoints objectForKey:point] animated:YES];
-- snap--
Do you have any suggestions to get this fixed?
Hi,
can you please add a functional link in the MapView which shows the actual map in Safari on GoogleMaps? When I do understand the google licenses correct, this is recommanded from Google to use their API.
Also I wonder how I could get a functionallity to the already existing license link in the map view?
Hi,
can you please make the init methods of the overlays public, so we can subclass them?
Often i need more then one polyline on a map and they must have different colors. So i need to add a color property to the overlay to handle it at the viewForOverlay method.
Thx
Thallius
Hi,
I was trying out MacMapKit today and I noticed something odd. With Interface Builder in Xcode 4.5.2, if I change a custom view to a MKMapView and leave the IBOutlet in my view controller disconnected in IB, I get the map view just fine.
However, if I connect the IBOutlet in IB, I get these error messages:
2013-01-12 19:49:28.455 Envisage Mac[13536:303] -[WebUndefined MKJSONValue]: unrecognized selector sent to instance 0x101b1fc70
2013-01-12 19:49:28.456 Envisage Mac[13536:303] -[WebUndefined MKJSONValue]: unrecognized selector sent to instance 0x101b1fc70
and my entire window is just showing nothing (e.g.: all views seem to not be displayed at all). Has anyone seen this before? I would love to use MacMapKit in my current project, but I can't seem to find a solution here.
Cheers,
Greg
Can anyone help me how to install the oomph macmapkit in xcode 4.
when i run the project it is giving
Unknown class MKMapView in Interface Builder file at path /Users/xlabz/Library/Developer/Xcode/DerivedData/Map-ekevpaputqacdsazsxinnhcucdrz/Build/Products/Debug/Map.app/Contents/Resources/en.lproj/MainMenu.nib.
i coudnt able to install the mapkit.Ibplugin.
Can anyone help to fix this issue
Hello. I have integrated your fantastic framework into my project. My goal is to be able to draw the night-day limit line across the whole earth map. But I have observed two weird behaviors.
I couldn't draw any overlay on awakeFromNib method, I have to wait a bit, and use performSelector:withObject:afterDelay:!
More importantly, I do not obtain always the same night area shape while running the same code on the same map! Could it be related on how the underlying webview perform the scripts objects? Any idea or hint would be greatly appreciated.
I'll continue to investigate and let you know anyway.
Can we have a rotating MKMapView, like the new private MKWorldView introduced in iOS 6? Pretty please?
Hi,
Not a big issue, but the link "Terms of use" does not work for me. Has anyone seen this before?
Thanks,
Valik
Does someone still use it?
e.g. add a property for the API Key to include in requests?
Am I correct that subtitles for annotations are not supported?
I do the following:
[anAnnotation setCoordinate: [[self mapView] centerCoordinate]];
[anAnnotation setTitle: [[self selectedLocation] name]];
[anAnnotation setSubtitle: @"Some subtitle"];
[[self mapView] addAnnotation:anAnnotation];
The annotation shows up ok and when I click the pin only the title is displayed in the call out.
Great work by the way for making this available!
how to get visible rect for the mapview cluestring?. Help me how to do cluestring with oomph mapview?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.