how to draw a ruler by google map API v3? - google-maps-api-3

i want draw ruler between 2 points.point will select by click.please help me.

Related

turf.js / turf.buffer and Google Maps API

I have a simple Google Map. I've added a marker at a given lat, lng.
I want to use turf.js to calculate a 1km buffer which I can then display as a Google Maps polygon.
The path that turf.buffer() returns is an ellipse. The distance from the marker to the boundary is correct latitudinally. However it is short of 1km longitudinally. It looks like there is a problem with the projection, however both the Google Maps API and turf.js documents state WGS84 is the default projection.
The end game is using turf.js to buffer Points, Polylines and Polygons so I can't just draw a Google Maps circle as a workaround unfortunately. I would consider migrating to Leaflet, however we are already quite invested in developing for the Google Maps API
I've created an htm file here showing the problem
I'm not going nuts. The buffer isnt geodesic so at the equator you get a round buffer and as you move north or south your buffer becomes squashed longitudinally towards the poles. The turf.js team are aware. See https://github.com/Turfjs/turf/issues/110 for full details.
I'm looking at using clipper.js instead. This is a cartesian library (2d) so in the uk i can use osgb eastings and northings. I will also have to flip north and south as clipper assumes we are dealing with standard graphics i.e. The y axis is inverted like in css with 0,0 being the top left.
Im going to use geotools to transform between osgb and wgs.

How to measure geometry efficiently in Google Map

I would like to add color to each house in the following google map example:
https://www.google.com/maps/#43.0748326,141.3479359,19z?hl=en
I found an example in leaflet that add colors to US states by giving the GeoJson data including the corners coordinates of each state. You can find the example here:
http://leafletjs.com/examples/choropleth.html
I would like to do it with Google Map. Two questions in front of me are:
1. How can I get the corner coordinates of houses?
2. As the number of houses which I want to add color is relatively large, how can I efficiently measure the corner coordinates of these houses?
How can I get the corner coordinates of houses?
You can't. The data in Google Maps API is not available to you, because of technical and legal restrictions.
You'll likely want to do this some other way: for instance, with OpenStreetMap data and one of the many services that visualizes it.

Plotting lat/lon points on Apple Maps vs Google Maps

I'm using Google Places to get latitude and longitude for places near a user, and then plotting those points on both Apple Maps (on iOS 6, using MKMapView) and plotting them on Google Maps (using Javascript V3). Now the problem is when I plot them on MKMapView the points are not in their correct positions, while on Google Maps they are. Why is this the case? Shouldn't plotting a latitude/longitude point on a map make it have the same point?
The points are the same. However The image overlays are going to be different. This could be due to the angles that the images where taken at, an we all know that Apple is having some small issues fixing there mapping program. I hope this helps.

Can Google Maps show Terrain at 45 degrees

I need the terrain view but cant seem to show it at 45 degrees. I dont want to use the google earth plug-in though. Can this be done? If not: are there other map apis that do this?
It can't be done with Google Maps API. Tilted maps are only available with the satellite/aerial tiles.
The docs state "setTilt(): Sets the angle of incidence for aerial imagery (available for SATELLITE and HYBRID map types) measured in degrees from the viewport plane to the map plane. The only supported values are 0, indicating no angle of incidence (no tilt), and 45 indicating a tilt of 45deg."

How to know how many mils are currently google map is showing

i have got center of map using map.getCenter(); and i got current zoom of google map using getZoom(); please tell me how can i calculate/get current show mils area in google map. i am using asp.net and javascript.
With GMap2.getBounds() you can get the visible rectangular region of the map view.
Then using these coordinates you can construct a GPolygon object and calculate the area in square meters using GPolygon.getArea() function. Then convert given area to mils (1 meter = 39 370.0787 mils).
the GLatLng object has a distanceFrom function that takes another GLatLng. The map has getBounds from which you'll be able to get the corners of interest, and check the distance between them.

Resources