Xamarin: Can I add an image to Google Maps with bounds on iOS? - google-maps

How do I add an image to google maps that has bounds? I have a rectangle image and would like to layer it on the map using its north-east and south-west points. Since the image is location based, I also want that image to re-size when the user zooms in and out.
Also posted on Xamarin forums: https://forums.xamarin.com/discussion/92528/can-i-add-an-image-to-google-maps-with-bounds

Related

How to change the orientation of the map of google maps in flutter

I'm drawing polyline in google maps with flutter, but the destination goes in the opposite direction, I need it to appear like the image
I have the map as the first image that I attach
https://ibb.co/pdXtbVB
I need the map like the second image
https://ibb.co/bvzypBW

Get static image from Google map for given area

I know that Google Maps provides an API for getting static images:
https://developers.google.com/maps/documentation/static-maps/intro
However that API gets as input a center point, zoom level and output image size.
In my case, I need an image that fits a given area taking as input the NW (top-left) and SE (bottom right) coordinates describing the rectangle of my area. I don't see that option within Google Maps API, so I'm wondering if there is another way to accomplish this.
You can omit the center and zoom parameters if you specify at least one marker. In this case you can show a certain area with a marker.
For example, I have bounds of Barcelona in Spain:
41.320004,2.069526 and 41.469576,2.22801
I can easily calculate the center position of the bounds:
41.39479,2.148768
Now, let's put a marker in the center of bounds and use the visible parameter of Static Maps API to specify NW and SE.
visible (optional) specifies one or more locations that should remain visible on the map, though no markers or other indicators will be displayed. Use this parameter to ensure that certain features or map locations are shown on the Google Static Maps API.
https://maps.googleapis.com/maps/api/staticmap?size=600x400&markers=icon%3Ahttp%3A%2F%2Fwww.google.com%2Fmapfiles%2Farrow.png%7C41.39479%2C2.148768&visible=41.320004%2C2.069526%7C41.469576%2C2.22801&key=api_key
Code snippet
<img src="https://maps.googleapis.com/maps/api/staticmap?size=600x400&markers=icon%3Ahttp%3A%2F%2Fwww.google.com%2Fmapfiles%2Farrow.png%7C41.39479%2C2.148768&visible=41.320004%2C2.069526%7C41.469576%2C2.22801&key=AIzaSyDztlrk_3CnzGHo7CFvLFqE_2bUKEq1JEU&signature=WkICJTRmmI1EgDK2VJI4l9lt3qA=" title="" />
As a result, you have an image with specified area. I think you can even go further if you create a transparent png file for marker icon.
Hope it helps!

google maps image overlay bounds doesn't match google earth?

I am trying to put an image overlay on google map with bounds. But the image is not mapping to the bounds. I tested using the same bounds in google earth and it works fine there. Can someone please let me know if I need to anything different with google maps to use the same bounds??
fixed using GroundOverlay instead of OverlayView

How to translate mercator map coordinates to relative screen coordinates?

I have a database with various map locations (latitude, longitude).
I've been using a map api (e.g. google maps) to plot these locations.
I am now experimenting to see if I can totally remove dependency of map apis and simply replace the map control with an image (an .png image).
Question:
How can I translate the map locations to be displayed properly onto this map image?
More details:
Basically, the map will be a rectangular area (i.e. Div element), where the top-left corner of the rectangle is obviously (0, 0). So basically the map locations will be displayed with respect to this top-left corner.
First off, where are you getting your geocodes from? If they are from Bing or Google Maps then you can only use those coordinates with those map controls. Using this coordinates without the map controls is against the terms of use of these API's. Assuming that these coordinates come from somewhere else you can overlay them on an image by first knowing some information about the image. At a minimium you will need to know two coordinates on the image and their relative pixel locations. From that you can then determine the scale and top left coordinate of the image. With this you can then fairly accurately position coordinates on the image using a lot of math. You can find a lot of useful math for this here: http://msdn.microsoft.com/en-us/library/bb259689.aspx I've writing a few blog posts on this a while back which you can find here: http://rbrundritt.wordpress.com/2008/10/25/ve-imagery-service-and-custom-icons/
If these coordinates come from Bing Maps you can easily display them on a map image using the Bing Maps Imagery Service: http://msdn.microsoft.com/en-us/library/ff701724.aspx

How the blue dot in google maps is centered at the current location?

i have several questions about the blue dot that appears when i launch the google maps in the browser. I tried implementing the same by using the blue dot image as the icon property of the marker and changing the position of the marker in accordance with the current location. So when i do this its actually like the maps are refreshing where as in the google maps application the blue dot is moving smoothly(and that's very awesome). My question
is whether blue dot in google maps is implemented as a marker which changes its
position or is it an inbuilt property of google maps which we can use.
i am using google maps API v3 to do this.
Thanks for any information.
It's a marker with custom icon which is placed with HTML 5 position provided by most recent browsers.
When the position change, you can change marker position.
http://www.kmcgraphics.com/google/