dylanfprice / angular-gm

AngularJS Google Maps Directives
MIT License
198 stars 47 forks source link

Markers not appearing #59

Closed ritz078 closed 9 years ago

ritz078 commented 10 years ago

I have a search result page where i show the results based on the input entered in the homepage.The page redirects from the home page.But after redirecting even the map loads but not the markers.But when i reload the page they appear. What is the problem??? PS: The issue is on chrome and is working fine on firefox.

Artforge commented 10 years ago

+1

ad-james commented 9 years ago

I'm having a similar problem to this, the map is loading but the markers/center coords are not, they work when I refresh the page.

ritz078 commented 9 years ago

Load data after a delay. In other words use $timeout.

brocksamson commented 9 years ago

Use the following snippet, this is fired after the map fully loads:

    $scope.$on('gmMapIdle', function(event, mapId){
        if(mapId === 'putYourMapIdHere'){
            //load data here
        }
    }

On Mon, Sep 1, 2014 at 11:56 AM, Ritesh Kumar notifications@github.com wrote:

Load data after a delay. In other words use $timeout.

— Reply to this email directly or view it on GitHub https://github.com/dylanfprice/angular-gm/issues/59#issuecomment-54078765 .

dylanfprice commented 9 years ago

brocksamson got it, you have to wait for the map to initialize before doing anything with it. Closing.