Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addPolygon(points) {
- var polygon = new google.maps.Polygon({
- paths: points,
- strokeColor: " #FFFFFF",
- strokeOpacity: 0.15,
- strokeWeight: 1.5,
- fillColor: "#99ff66",
- fillOpacity: 0.14
- });
- var tooltip = document.createElement('div');
- tooltip.innerHTML = "Alok";
- google.maps.event.addListener(polygon,'mouseover',function(){
- tooltip.style.visibility = 'visible';
- });
- google.maps.event.addListener(polygon,'mouseout',function(){
- tooltip.style.visibility = 'hidden';
- });
- polygon.setMap(map);
- }
- //Add a listener for the click event
- google.maps.event.addListener('click', showArrays);
- infoWindow = new google.maps.InfoWindow;
- function showArrays(event) {
- var contentString = 'Content here';
- // Replace the info window's content and position.
- infoWindow.setContent(contentString);
- infoWindow.setPosition(event.latLng);
- infoWindow.open(map);
- }
- map.data.addListener('mouseover', mouseOverDataItem);
- map.data.addListener('mouseout', mouseOutOfDataItem));
- function mouseOverDataItem(mouseEvent) {
- const titleText = mouseEvent.feature.getProperty('propContainingTooltipText');
- if (infoText) {
- map.getDiv().setAttribute('title', infoText);
- }
- }
- function mouseOutOfDataItem(mouseEvent) {
- map.getDiv().removeAttribute('title');
- }
Add Comment
Please, Sign In to add comment