How to remove an arrow from Google Maps geolocation marker (iOS)? - ios

How do you remove an arrow from Google Maps geolocation marker (iOS)?
This is an arrow I'm talking about

If you really want to remove that arrow everywhere in your app from Google Maps SDK, it might be easiest to modify asset in GoogleMaps.framework.
Just navigate (cd) to GoogleMaps.framework/Versions/A/Resources/GoogleMaps.bundle/GMSCoreResources.bundle/ and notice the following files:
GMSSprites-0-1x.png
GMSSprites-0-2x.png
GMSSprites-0-3x.png
If you open these files, you can notice the arrow is there. So just edit directly in the asset by replacing arrow by nothing (transparent pixels).
Note: I haven't test it myself and this is not tested solution, but I believe it should work.
Disclaimer: I'm not sure, but I think this modification might violate Terms & Conditions for using the SDK. I don't get any responsibility for such modification, it's your call...

There is no way to do this with current version of the SDK (1.9.1), and actually there is an open issue with this request: Look here.
As a work around, you can hide the default button with:
_map.myLocationEnabled = NO;
Then create a custom GMSMarker
GMSMarker *pointMarker = [GMSMarker markerWithPosition:currentPosition];
pointMarker.icon = [UIImage imageNamed:#"YourImage"];
pointMarker.map = _map;
And change the position of it using a CLLocationManager, so it always show the current position. It's a bit tricky but is the only way, I could think, that you can achieve this. If you need a more complete example let me know.

Related

Here Map SDK IOS (Premium) tap on the marker

Good afternoon, who once worked with heremap sdk premium for ios. How do I make it possible to click on the NMAMapMarker? What they have written in the documentation does not describe it, but maybe I'm wrong.
there are different option available for NMAMapMarker to use.
This represents a marker used to display an icon on a geographical position on a map. The map handles proper placement of icons on the screen as well as panning and rotation.
+mapMarkerWithGeoCoordinates:
+mapMarkerWithGeoCoordinates:icon:
+mapMarkerWithGeoCoordinates:image:
coordinates
icon
draggable
draggingOffsetEnabled
anchorOffset
-initWithGeoCoordinates:
-initWithGeoCoordinates:icon:
-initWithGeoCoordinates:image:
-setAnchorOffsetUsingLayoutPosition:
-setSize:forZoomLevel:
-setSize:forZoomRange:
-resetIconSize
Check for more details : https://developer.here.com/documentation/ios-premium/3.18/api_reference_jazzy/Classes/NMAMapMarker.html#%2Fc:objc(cs)NMAMapMarker(im)initWithGeoCoordinates.
Please revert with your code implementation in case of any further concern.

How to remove map Places and annotations from MKMapKit in Objective c

Hi i have an MapView in My Project i need to remove all the labels Annotations, places from MapView. Looks like Plain mapView
i tried the Following Code its working fine but still i getting some building details, Street names and all i want that also to be removed only User Location Can be Visible
here is the code:
[mapView setShowsPointsOfInterest:NO];
the above code working fine and removed default location icons from mapKit but not removing all Icons and Label, how to remove all default icons and label names from MapKit
starting with iOS 11, you can set
mapView.mapType = .mutedStandard
This removes distracting details from the map.
Apple uses this type of map, when they want to emphasise a transit route and everything else should be in the background without distracting.
Starting with iOS 13 you have even more fine grained control:
Using MKMapKit.pointOfInterestFilter you can include or exclude specific categories of points of interest.
So if you're making an App 'Best restaurants in my city', your app has its own restaurant annotations, you remove the restaurant category from Apple's point of interests, but all other POI categories are just fine for you.
https://developer.apple.com/documentation/mapkit/mkmapview/3143417-pointofinterestfilter?language=objc
Starting with iOS 16 most APIs described above are deprecated, but the ideas remain the same.
Now you set MKMapView.preferredConfiguration to a subclass of class MKMapConfiguration. These subclasses are
MKStandardMapConfiguration
MKHybridMapConfiguration
MKImageryMapConfiguration
Each of these classes have exactly those parameters that make sense for the type of map.
For example, MKImageryMapConfiguration shows no POIS and no roads, so it makes no sense that this class has parameters like pointOfInterestFilter or showsTraffic.
Classes MKStandardMapConfiguration and MKHybridMapConfiguration now have a parameter pointOfInterestFilter that has been in MKMapKit.pointOfInterestFilter in earlier iOS versions.
Old deprecated mapView.mapType = .mutedStandard is now init parameter emphasisStyle of class MKStandardMapConfiguration
P.S.
Please also have a look at the other answer of #Grimxn. Bringing your own overlay is much effort but a valid alternative.
It seems to be a bit of a kludge.
Firstly, you replace the map with an overlay of your own...
self.mapView.insertOverlay(underlay, at: 0, level: MKOverlayLevel.aboveLabels)
This can be anything. If you want to use Google Maps, or Open Street Map, you can, like this:
let url = "http://mt0.google.com/vt/x={x}&y={y}&z={z}"
//let url = "http://c.tile.openstreetmap.org/{z}/{x}/{y}.png"
let underlay = MKTileOverlay(urlTemplate: url)
underlay.canReplaceMapContent = true
alternatively, if you just want blank, give it a default layer:
let underlay = MKTileOverlay()
underlay.canReplaceMapContent = true
The parameter level: allows you to specify whether your background obscures just their background map, or the background & roads or the background & labels, but NOT above everything. The documentation says:
MKOverlayLevel.aboveLabels
case aboveLabels = 1
Place the overlay above map labels, shields, or point-of-interest
icons but below annotations and 3D projections of buildings.
I can't get that to work for the default MKTileOverlay() - it seems to do the same as the alternative .aboveRoads - i.e. it hides all of the map including roads, but not labels. When you specify one of the external overlays (e.g. google) - they DO replace the labels. Probably a bug, so the final step, to completely obliterate the labels is
self.mapView.mapType = .satellite
This removes the labels, and your overlay is hiding the satellite map. Not neat, but not difficult, either.
In case anyone is coming back to this, as of writing this, if you want literally just a map and road names, no points of interest, just use
mapView.pointOfInterestFilter = .excludingAll

How to change Apple Map (MKMapView) background colors?

I've Required an iOS application with a black theme, and would really like to make the displayed Apple Map also in black colors.
I see nothing in the native documentation that talks about changing look for MKMapView.
I've Googled the topic and tried to change MKOverlayView.But, I couldn't find anything.
Is this even possible? Can I change the background colors of the Apple Map.
Thank you.
You can customize map using MapBoxKit
https://www.mapbox.com/ios-sdk/api/3.6.4/runtime-styling.html
In Mapkit you can only set dark mode as hybrid as follow:
in viewDidLoad write below code:-
mapView.mapType = .Hybrid
Need to add Privacy - Photo Library Usage Description in info.plist
also you can set from IB as above:-

MapBox iOS SDK - First steps

I'm having problems taking the first few steps with MapBox iOS SDK (1.4.1).
I've started with the suggested code over here: https://www.mapbox.com/mapbox-ios-sdk/examples/
- (void)viewDidLoad {
[super viewDidLoad];
self.mapBoxView.tileSource = [[RMMapboxSource alloc] initWithMapID:#"my_map_id" enablingDataOnMapView:_mapBoxView];
self.mapBoxView.userTrackingMode = RMUserTrackingModeNone;
CLLocationCoordinate2D centerLocation;
centerLocation.latitude = NRMapStartLatitude;
centerLocation.longitude = NRMapStartLongitude;
[self.mapBoxView setCenterCoordinate:centerLocation];
[self.mapBoxView setZoom:7 animated:YES];
}
No matter what I do the map starts at a location in Washington D.C. but I've set the center coordinate to be somewhere in Europe.
The same with the zoom. No matter what value I try it has no effect on the map.
There's something with the NSLog output that confuses me. At startup it says:
Using watermarked example map ID examples.map-z2effxa8. Please go to
https://mapbox.com and create your own map style.
I was assuming that this is something that I already did by registering for a free account there and starting with my first project.
Added the tilesource 'My First Map' to the container
Origin is calculated at: 120.786199, -85.000000 Map initialised. tileSource:RMMapboxSource:
Mapbox iOS Example, zooms 0-19, no interactivity, minZoom:2.000000, maxZoom:18.000000,
zoom:18.000000 at {-77.032458,38.913175}
Apparently the sample project in the iOS SDK is loaded and ignoring everything else I try to configure.
So, how do I configure the map so I can interact with the API. What am I missing?
Any kind of help is highly appreciated. Thank you!
OK, whoever is struggling with that. The trick is to set the zoom BEFORE you set the center coordinate..
..for whatever reason.

Is there a way to change what the disclosure button in Apple Maps does?

I have tried to use MapView, but after finding out that I won't be able to add directions, I am switching to Apple Maps. At first I wanted to add a navigation bar so that I could go back to my app from Apple Maps, but I have been informed that that's not possible. So now, I want to know if I can change the page that opens when I click an annotation view disclosure button in Apple Maps, and possibly lead it back to my app that way by opening one of my local view controllers.
Apple is giving me a hard time with navigating these maps...
If it is possible, please give a code sample or something, or explain what else I can do to lead Apple Maps back to my app.
So far, I use this code to open Apple Maps:
- (IBAction)mapPressed1:(id)sender
{
CLLocationCoordinate2D miamizoo = CLLocationCoordinate2DMake(25.613336,-80.398437);
MKPlacemark *placemark = [[MKPlacemark alloc] initWithCoordinate:miamizoo addressDictionary:nil];
MKMapItem *item = [[MKMapItem alloc] initWithPlacemark:placemark];
item.name = #"Miami Zoo";
[item openInMapsWithLaunchOptions:nil];
}
Thanks; all help is appreciated.
my initial quess is that it will not be possible because apple maps is an independent app from the one you're writing.
Apple maps is a ready, closed up application without any modification possibilities, so you will not be able to change the behavior of the disclosure button / add a bar into apple maps.
Anyone, please prove me wrong, because I also was puzzled about the missing direction feature in the map API.You will either have to use overlays for directions in map API or you bite the bullet and buy a ready made direction api for maps.
The way I'm currently doing it is similar to yours. I start up apple maps with a direction request and change into it, no overlays.
I hope they will make up for that in ios7.
They do make up for it. Didnt have the chance to put my hands on the ios7 beta, but it will be there.
El

Resources