Rotate map with one finger (using PAN gesture) - ionic-framework

i am using cordova-plugin-googlemaps(1.4.1) in ionic(3.4.0) and i am looking for a way to rotate the map with one finger.The plugin's documentation doesn't have any events for drag.
I found some custom code for android here How can I rotate on Google Maps API(android) with only 1 finger? but i am not very familiar with java, i'll still be missing IOS functionality and this means i have to modify base plugin(i think). So I need something for Ionic's google maps plugin.
Thanks!

Related

Zoom & pan with trackpad on web without clicking

I'm trying to add the panning & zoom functionality on web & desktop for both trackpad & touch (without a modifier, click or key).
The main issue i'm facing is that the widgets I am using i.e. GestureDetector/onScale, InteractiveViewer(based on onScale)... are always working on desktop as I expect but fail to work on web: On web, zoom is fine but the only way to pan is by a tap + a 2 fingers swipe.
I am not sure if this is a limitation of browsers/js, flutter implementation or If I am missing something.
Do you have any approach to implement this?
Relevant links:
https://github.com/flutter/engine/pull/36342
https://kenneth.io/post/detecting-multi-touch-trackpad-gestures-in-javascript
I have both behaviors implemented via onPointerSignal but it only works because I make a difference between panning & zooming by pressing a specific key on top of a simple scroll event.
onPointerPanZoomStart from Listener is trackpad-specific but only works on windows.
Web/js seems to be using the ctrlKey attached to a mouse event to filter pan zoom & zoom trackpad event.
At the moment i'm exploring MultiTapGestureRecognizer and if supported by web and not touch specific, will allow me to get different pointer ids and calculate proper deltas.

Bing Maps v8 Route Dragging

Back in Bing Maps v7, if you dragged the route to the edge of your map, it would move the map in that direction. This saves the user from having to drop that route marker, move the map themselves, and then pick back up the marker to continue altering the route to meet their needs. For example, if you go to https://www.bingmapsportal.com/isdk/ajaxv7#DirectionsModule2, you will be able to try out this functionality. However, if you go to http://www.bing.com/api/maps/sdkrelease/mapcontrol/isdk#directionsGetRequestOptions+JS, you will not see the map move as you drag the route to the edge of the map.
I have looked at the api for directionsRenderOptions (https://msdn.microsoft.com/library/mt750365.aspx) and directionsRequestOptions (https://msdn.microsoft.com/library/mt750373.aspx), but I don't see anything that seems related to being able to move the map as you drag a route. Any help would be much appreciated.
I don't believe this is a scenario that will be supported in V8. Not sure if this is something that can be easily added as all the rendering happens on an HTML5 canvas in V8 and is re-rendered when it moves. Will add a feature request for this for the team to look into.

Tile Overlays in iPhone App

There is a webpage I am looking at that displays a Google Map (via javascript), but certain areas of the map have an overlay (textures appear different than the rest of the map, etc.). From what I can gather, this is done on the webpage via a getTileURL function, which depends on the zoom level and current coordinate.
I am interested in portraying this same overlay in my iPhone application, which currently has a mapView set up. Is there anyway to implement the same sort of getTile function in objective-c for a mapView?
If someone could please provide some sample code or point me in the right direction I would greatly appreciate it. Thank you.

iPhone - MapKit - Searching locations and moving annotations

I want to make an app that partially mimics some of the behavior the standard map application has. This has proven difficult. First of all, I don't understand how you make annotations movable. How exactly do you do this?
Second: how do you search for locations?
Moving annotations
I'm assuming you're after the behavior of Maps.app where you tap and hold on to a pin to move it around freely. As far as I know, there is no built in way of moving annotations around. Since annotations are subclasses of UIView though, you can draw them where and how you'd like. You could for example detect a tap-n-hold on the annotation, and when "unlocked" change the centerOffset value of your annotation to move it around with the touch. When the user lets go of the the view, you can note the position on the screen, and use the MKMapView method convertPoint:toCoordinateFromView: to get the coordinates that the pin was released.
Search for location
What you are looking for is called Forward Geocoding. Unfortunately, MapKit only comes with Reverse Geocoding (the process of converting GPS coordinates to country/city/street/etc). There is, however, several alternatives. Here's a few ways:
http://code.google.com/apis/maps/documentation/geocoding/index.html
http://cloudmade.com/products/iphone-sdk
http://www.geonames.org/export/web-services.html
http://developer.yahoo.com/maps/rest/V1/geocode.html
Note that many geocoding APIs are licensed under Creative Commons, or similar licenses.
You should be able to get drag-and-drop annotations going with the help of this blog post. I used it to do the same thing, and it was pretty simple to get going.
MapKit annotation drag and drop with callout info update

MKMapView tile-based overlay

I want to draw a tile-based overlay on top of a MKMapView, but there's no obvious way to do this.
This appears to be tricky since you can zoom to any level with MKMapView (unlike Google Maps).
Has anyone attempted to do this?
Incase this question is still getting views readers should check out the HazardMap and TileMap demo code from WWDC2010.
I'm working on a game where I need to overlay objects on the map and have them scroll and zoom with the map.
Using annotation views I've been able to solve the first problem and partially solve the second problem. Annotations automatically move with the map. For scaling them, I use the mapView:regionDidChangeAnimated: delegate method to resize my annotations after a zoom event. The problem is that the annotations don't rescale until after the zoom gesture is complete.
I can think of two approaches other than filing a bug with Apple requesting that they provide an API for map overlays:
Put a (mostly invisible) view over the top of the MKMapView that intercepts zoom and scroll events, handles them, and passes them on to the map view.
Customize the open-source RouteMe library with tiles from Open Street Map or CloudMade (the former is slow, the latter costs money). But it's fully open source so you should be able to do overlays to your heart's content. You could also run your own tile server that does the tile overlays on the server.
Something I discovered later:
http://www.gisnotes.com/wordpress/2009/10/iphone-devnote-14-drawing-a-point-line-polygon-on-top-of-mkmapview/
Not quite a tile-based solution, but interesting nonetheless.