## ng-show only working when set to true from the beginning

I am creating a map-based application using the angularjs library ng-map and have encountered a rather strange bug. I have the following code: script.js vm.showMarker = true //Boolean to toggle marker vm.toggleMarker = function(){ if(vm.map.getZoom()>=12){ vm.showMarker = true; } else { vm.showMarker = false; } $scope.$apply(); } html <ng-map on-zoom-changed=”vm.toggleMarker()” zoom=”9″> <custom-marker> <div ng-show=”vm.showMarker”> … </div> </custom-marker> </ng-map> The idea is that the marker should only be visible if the map is zoomed enough. If […]

## zIndex of map label has no effect if it’s used with GeoJSON layer

I am using Google map label to display some property from GeoJSON data on GeoJSON layer. The layer has some dark color and the label is being created behind the GeoJSON data layer due to that the map label looks blurry. I tried to apply bigger zIndex for label than data layer but it has no effect. Check out the issue in plunker. https://plnkr.co/edit/KvhIoRoibsbKk9e4k1Ch?p=preview <!DOCTYPE html> <html ng-app=”myApp”> <head> <meta name=”viewport” content=”initial-scale=1.0, user-scalable=no” /> <script […]

## Show Google Map without Current Location Permission using JavaScript

I am trying to show few pre-defined locations using google maps in a web application. But while loading map for the first time browser asks permission to get the Current location. If user block that permission then map doesn’t load at all. It just displays a blank screen. Why does google maps need to know current location even when I’m not using that anywhere in the application? How can i show simple google map with […]

## angular 2: canvas and google maps

I am trying to add google map on canvas. I am using angular google maps module(agm). How can I achieve this using agm-map module. please find the code below. @html <canvas #canvas> <agm-map [latitude]=”latitude” [longitude]=”longitude” [scrollwheel]=”true” [zoom]=”zoom”> <agm-marker [latitude]=”latitude” [longitude]=”longitude”></agm-marker> </agm-map> </canvas> @component draw() { if (this.canvas.getContext) { let canvas = this.canvas; if (canvas.getContext){ let ctx = canvas.getContext(‘2d’); //to do for adding agm-map ?? } } } Source: AngularJS