Geo fencing for iOS - swift

I just wanted to enable only particular height-lighted country from entire google map to let the user select any location just like Android.
I referred so many link but the only shape I could monitor is circular not country shape.
I have a string of lat longs of whole country.

I referred so many link but the only shape I could monitor is circular not country shape.
Unfortunately, iOS currently only lets you monitor circular regions, which means that you'll need to do some more work to monitor arbitrary-shaped regions. You'll want to do something like:
Create a circular region that's tangent to the nearest border and start monitoring it.
When you get a notification that the user has moved outside the region, check to see whether they've crossed the border. If not, remove the current region and go to step 1.

Related

How to make a SVG interactive in flutter?

So I have this world map SVG and what I want is that when someone clicks on a country, that particular country gets highlighted and I can extract that country's name. How to achieve something like this in flutter?
Here is the SVG that I'm looking forward to using:
https://simplemaps.com/resources/svg-world
You could work with click coordinates:
Assign every country an interval of coordinates
Get click coordinates
Loop through coordinate-intervals
Find closest coordinate to click
Get country where coordinate belongs to
Show country-information on touch coordinates until new touch is registered
Highlighting the country wouldn't work this way. I believe there are librarys for working with vectors.

Is there a way to create searchable Area with Google Maps in Flutter (using google_maps_flutter)?

Let's say you want to build an app where people can find out whether the location the users are on has a risk of being flooded. You want to be able to create flood zone areas on the map and compare the user geolocation relative to the area. How do I do that with google_maps_flutter? or is there any other way to do it with plugins in flutter?
What I have in mind right now is to create polygons on the map and perform some geometric operations with it (if that is even possible). I have Esri SHP files which I will export to json and parse it in flutter and then use the results to draw polygons of the areas.
no code just yet..
You can make use of 'overlay widgets' in Flutter. You can draw, say a circle, indicating a flood zone with colour and radius in accordance with the probability (or other parameters).
Depending on how you want to display, you can create a separate UI control to display the comparision with reference to the user's geo-location.

How to show single annotation pin for a region when i have multiple coordinates for that region?

I am working on the map application and as per requirement i need to show a single pin for a single region even if it has multiple user coordinates when its completely zoomed out but when its zoomed in to the map then i should display all the pins as per its coordinates.
I have given example below to explain my problem.
I have city New York on this city I have 100 pins on my mapview when I am zooming out of my map it should show me only one annotation pin on the place of 100 pins but when I am zooming in then it should show again 100 pin on map.
Does any one knows about this. I need suggestion. Please note that I am getting all the locations from web services except my current location. This should not be affecting application so that application shouldn't become slow.
Please suggest some solution.
The Apple WWDC 2011 video, "Visualizing information geographically with MapKit", https://developer.apple.com/videos/wwdc/2011/
shows how to cluster map annotations - it's exactly what you need.
Of course there is a control for that...
Take a look at OpenClusterMapView, it should be exactly what you need.
There is no API for this.
You will need to manage the pins yourself. As a user zooms in on the map, you will need to decide at what point to remove the aggregated pin and add the individual pins. Inversely, as a user zooms out you will need to remove the individual pins and replace with the aggregated pin.
Might be a good idea to use a custom pin for the aggregated pin to suggest that it represents multiple pins.
I think this link might help you know the current zoom level:
Zoom and Region
Link to a similar question:
Pin Overlap

Iphone maps direction question

In the iPhone maps application under directions, if I try to search for directions with current location and the destination being a place ex:Shell gas station, sometimes it returns the result of the Shell station closest to my location. At other times this returns the address in some other state in the US. This happens randomly.
Any clues why this happens or any way to get around it ?
Searching for a point of interest (POI) in the Maps application tries to use the region defined by the visible map area to search. If that is too large an area, it uses your last known location. If you'd like it to search for shell gas stations near you, touch the 'current location' button and then do the search.

draw route on static image map iphone

I'm developing a campus navigation app.
I have an image which displays building on the campus.
I want draw a route from the user location to destination building the use wants to go.
Wondering how to draw a route on static custom image.
Been searching on internet but cannot find any clue how to develop.
All documentation on internet are about drawing route on Google map.
any hint will be much much appreciated.
You'll have to manually collect latitude and longitude information for each of your map image's four corners. You'll also have to manually specify, in terms of co-ordinates on the image, the position of every possible turning point in the building's corridors, stairs etc. Then you can get the device's current latitude and longitude (see the Location Awareness Programming Guide), translate it into a position on your image, and overlay a transparent view with a red line on it stopping at each of your manually collected waypoints. There remains the graph theory problem of finding the shortest route through the network of waypoints. I suggest the A* algorithm.