Here Map SDK IOS (Premium) tap on the marker - ios

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.

Related

iOS Extension with transparent background

I would like to add transparency to iOS widget, but it looks like it is not supported by default.
Most widgets are non transparent, but I have an example of transparent one.
That's why I ask you about any tips on how to implement such feature for widgets.
Thanks in advance!
Short answer is you can't (as of iOS 14.5).
Most "pseudo-transparent" non-Apple widgets involve asking the user for the wallpaper they're using, then cropping it accordingly and using the result as a widget's background, creating an illusion of transparency at that exact widget position. This can (and will) break parallax and other such effects.
That is if we're talking WidgetKit, of course; legacy Today widgets may give you a bit more freedom, although you likely won't achieve full transparency without hacks like above.
Vym is right. We just developed a widget app that can implement such a pseudo-transparent effect.
Hoping this might help others who want to achieve such effect.
Here is how:
Guide the user to take a screenshot(with current wallpaper) on a blank home screen, and save it.
Tell the user to provide the widget with the widget position. This can be done via the Siri Intents Extension.
public enum WidgetCropPosition: Int {
case smallTopLeft
case smallTopRight
case smallCenterLeft
case smallCenterRight
case smallBottomLeft
case smallBottomRight
case mediumTop
case mediumCenter
case mediumBottom
case largeTop
case largeBottom
}
Crop the saved wallpaper according to the widget position.
The pain point here is the widget of the same position does don't have the same frame location on different devices. You have to do a lookup the table to find the correct position.
This is a Swift Package that helps to crop the correct frame on different iOS devices.Translucent

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 custom user location image

I'm using Mapbox 2.1.2 where I need to set a custom image for the user location annotation. This is not a problem to implement both in MapKit or GoogleMaps but how do I deal with this using Mapbox?
If this is not possible, how can I track the user's location? I've already tried to add MGLPointAnnotation objects on location update. But then I have to have a cache of annotations and clear it on adding a new, most recent one which also leads to a "flash" ugly effect.
Background on customizing the user location annotation: https://github.com/mapbox/mapbox-gl-native/issues/2272
The best way to do this right now is to follow the guidance there, which is to customize the MGLUserLocationAnnotation class in the source code (the SDK is open source).
As of Mapbox iOS SDK v3.4.0, you can provide your own user location annotation view that contains a UIImageView. In your MGLMapViewDelegate, implement the -mapView:viewForAnnotation: method to check whether the annotation is equal to the MGLMapView’s userLocation; if so, return a new MGLUserLocationAnnotationView that contains a UIImageView. There’s a work-in-progress example of customizing the user dot in this pull request.

How to remove an arrow from Google Maps geolocation marker (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.

Resources