A
A
Artemdikmarov2016-10-25 18:03:33
JavaScript
Artemdikmarov, 2016-10-25 18:03:33

How to implement some things using Google Map API?

Hello! I hope there are wizards on Google Maps Api here:
1. How can LatLng compare two objects? (like get one google.maps.LatLng, another google.maps.LatLng and compare them by Y, for the condition).
2. How can I set the "padding" type for the map itself (by default, there is functionality, such as if we click on the marker, an infowindow opens. If it is close to the borders of the map, then it shifts (15px in X, 70px in Y - these values ​​are i and call it padding))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Belov, 2016-10-28
@AlexanderBelov

one.

var LatLng1 = new google.maps.LatLng(-34.397, 150.644),
      LatLng2 = new google.maps.LatLng(-34.397, 150.644);
LatLng1.equals(LatLng2) //true если равны, false если не равны

2. Place the block with the map inside another block and set the required indent to the container block.
<div id="mapContainer">
   <div id="map"></div>
</div>

#mapContainer {
    padding: 100px;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question