Creating Polygon using Google Map API - google-maps

I am referring the URL : https://housing.com/in/buy/search?f=eyJiYXNlIjpbeyJ0eXBlIjoiUE9MWSIsInV1aWQiOiJmMGZhNTIwNjI0ZjNhOGRlOWY4NSIsImxhYmVsIjoiUGltcGxlIFNhdWRhZ2FyIn1dLCJ2IjoyLCJzIjoiZCJ9
I am trying to make something similar, can anybody suggest how can I achieve it. I tried to search and explore google map APIs, but could not understand which API in particular can be used.

Try to read the Google Maps Showcase. Millions of apps and sites are using Google Maps APIs. Browse the showcase to see some of our favorite implementations.
You can use the MarkerClusterer library in combination with the Google Maps JavaScript API to combine markers of close proximity into clusters, and simplify the display of markers on the map.
Here's a sample project for MarkerCluster: https://github.com/googlemaps/v3-utility-library/tree/master/markerclusterer

Polygon is one feature of Drawing tools of Google Maps. The DrawingManager class provides a graphical interface for users to draw polygons, rectangles, polylines, circles, and markers on the map.
The Drawing Tools are a self-contained library, separate from the main Maps API JavaScript code. To use the functionality contained within this library, you must first load it using the libraries parameter in the Maps API bootstrap URL:
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=drawing">
</script>
Once you’ve added the libraries parameter, you can create a DrawingManager object as follows:
var drawingManager = new google.maps.drawing.DrawingManager();
drawingManager.setMap(map);
Reference: https://developers.google.com/maps/documentation/javascript/examples/drawing-tools

Related

Custom Google Map (with markers) + Custom .json embed to website

Been trying to get my head around this for some time although clearly i'm missing something
what i am trying to do is not draw a new map although provide a src link to say (https://www.google.com/maps/d/u/0/embed?mid=1xI_dALvs0A-oySG-dkf4BYeDyBk) to something of the below
https://developers.google.com/maps/documentation/javascript/styling
I want to embed my custom map with the markers to my site and styling it
I guess map = new google.maps.Map(document.getElementById('map') has something to do with the drawing of the new map although not too sure as to take it out or what.
is there anyway to use the custom map + .json code rather than hard coding an array of poi's as would like to rely on it pointing through to the custom map link for the markers
is there any better way to get around this
Google Maps JavaScript API can load data that were stored in GeoJSON format. So you have to look into GeoJSON specification and create corresponding file for your markers (or polylines, polygons, etc.).
The Google Maps JavaScript API documentation explains how to load the GeoJSON data via Data layer of maps:
https://developers.google.com/maps/documentation/javascript/datalayer#load_geojson
You should combine the styling example with GeoJSON example from the documentation to achieve your goal.
Here is the github link - https://github.com/hpi1hpi/custom-google-map-with-json
Add google map with custom color and data from JSON with slider

Use 3D View Google Map in Leaflet plugin

I Use Leaflet Map Plugin. i Write this code for create and load google map tiles in LeafLet
var map = L.map('map').setView([31.2744015, 48.7251283], 18);
// load a tile layer
//Satellite:
L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', {
maxZoom: 20,
mapTypeId: google.maps.MapTypeId.SATELLITE,
subdomains: ['mt0', 'mt1', 'mt2', 'mt3']
}).addTo(map);
this code work fine. But I Want Load another google Map option in this plugin Like 3D View map
But will this be done?
thanks for help me.
Two things:
Loading map tiles from Google using just a L.TileLayer contravenes the terms&conditions of Google Maps (the part about "accessing the content only through the Google Maps API"). Do not be surprised if Google gets angry at that.
As pointed out in the answers to the question «Leaflet Map API with Google Satellite Layer» , look in the Leaflet plugins list. In particular, GoogleMutant might be of interest.
As of now, Leaflet is able to display 2D maps only. There are no plans to make it display oblique imagery, or provide tilt capabilities.
If you need these features, you might want to have a look at other web mapping libraries, such as https://www.mapbox.com/mapbox-gl-js/api/ or https://cesiumjs.org/. These can handle more degrees of camera freedom, and some degree of terrain elevation display.
https://labs.mapbox.com/bites/00093/
pls see the source code of it , as
window.setInterval(function(){
$('.rotating').attr('style','-webkit-transform:rotateZ('+angle+'deg);-moz-transform:rotateZ('+angle+'deg);-moz-transition:-moz-transform 0.75s;');
if ($('.rotating').length>0) $('.pivotmarker').attr('style','-webkit-transform: rotateY('+angle+'deg);-moz-transform: rotateY('+angle+'deg);-moz-transition:-moz-transform 0.75s;');
angle=angle*-1;
},1500);
may it help

Google Maps: InfoWindow vs InfoBox vs InfoBubble

InfoWindow is a standard part of the Google Maps API v3, allowing the user to create a pop-up window on a map, but there's also two other libraries that seem to do the same thing:
InfoBox
InfoBubble
I understand that these two most likely offer more customization options than the original InfoWindow, but are there any other differences? Are they competitors or do they do different jobs? Is one more up-to-date than the other?
While InfoWindow is the built-in object of the Google Maps JavaScript API, InfoBox and InfoBubble are "third-party" objects of the InfoWindow, which extend it. Because of this the two are located in the utility-library.
So they are doing the same job, but are more enhanced concerning customizations. The InfoBubble seems to be better documented and maintained. The InfoBox library is also not mentioned on the Google Maps Github site anymore. So if you have to make the choice I would go for InfoBubble instead of InfoBox (if you need more options compared to the standard InfoWindow).

Set camera in Google Maps 3D view using JavaScript

I have recorded flight track data (lat, lon, altitude, angle, speed...) and want to simulate a cockpit view of the recorded flight.
Is there a JavaScript API to do this in 3D Google Maps (set and move camera view in Google Maps 3D)?
I am new to Google Maps API and cannot find documentation for this.
I think you can't do it using Javascript API. But closest thing for this is by using Styled Maps. As of now only Google Maps Android API and Google Maps SDK for iOS
can do it.
I found the very cool framework cesiumjs
which provides excatly what i was searching for.
Set camera with heading, roll, pitch and altitude.

Annotate Google Map

i am placing some locations on google map. i need to set text next to marker on the map. is there a way to do it ? because i can not see any tools or option provided by google maps to do.
its not an application i am developing or coding. i am just saving locations on google map site.
Thanks
Look at the InfoBox from the utility libraries. There is an example in the documentation.