JavaScript Angular UI Google Maps center marker angular google maps api,angular google maps component,angular google

I'm using Angular(UI)-Google-Maps (2.1.5) and AngularJS (1.3.13)

I want a marker that is always in the center of the map. The problem is that the marker only updates its position when I stop dragging.

I use the drag event like this:

drag: function(maps) {     
    $scope.map.marker.center.coords = $scope.map.center;
}

I also count the amount, how often the drag event triggers, which is much higher than the updates of the marker (or map). Here's an example: http://plnkr.co/edit/M39CFc

I also tried center_changed and bounds_changed with the same result.

Answer:1

To put the marker in the center of the map make use of the following tag:

<ui-gmap-marker coords="map.center" idkey="1" ng-cloak>

Although this technique is discouraged as it will also move the marker when the map is dragged. To get a workaround with this situation use:

marker.coords = Object.create(coords)
Answer:2

i'm loading somthing like this in DOM using AJAX: <div class="elm_class"></div> <div class="elm_class"></div> <div class="elm_class"></div> and then I need to ...

i'm loading somthing like this in DOM using AJAX: <div class="elm_class"></div> <div class="elm_class"></div> <div class="elm_class"></div> and then I need to ...

  1. protractor wait for multiple elements

<p>1</p> <p>2</p> <p>3</p> I want to hide / delete the second <p> without using .eq(), or CSS nth-child(2), I just want to catch the value if it's 2 then ...

<p>1</p> <p>2</p> <p>3</p> I want to hide / delete the second <p> without using .eq(), or CSS nth-child(2), I just want to catch the value if it's 2 then ...

  1. selector based on text

I want to upload user uploaded file (from website <form>) to my FTP server, in which I want to bypass the server and want that file should be sent to FTP server directly. Is it possible using ...

I want to upload user uploaded file (from website <form>) to my FTP server, in which I want to bypass the server and want that file should be sent to FTP server directly. Is it possible using ...

  1. upload local file to s3
  2. upload local file to server ssh
  3. upload local file to spotify
  4. upload local file to s3 python
  5. upload local file to ec2
  6. upload local file to dbfs
  7. upload local file to s3 boto3
  8. upload local file to s3 aws cli
  9. upload local file to colab
  10. upload local file to databricks
  11. upload local file to ec2 instance
  12. upload local file to hdfs
  13. upload local file javascript
  14. upload local file to server
  15. upload local file to s3 bucket
  16. upload local file to jupyter notebook
  17. upload local file to github
  18. upload local file to azure blob
  19. upload local file to linux server
  20. upload local file to azure blob c#

I'm using an ajax call to append rows dynamically to a table using jQuery. I would like the button generated in each row to display a modal with data specific to the items in that particular row. I ...

I'm using an ajax call to append rows dynamically to a table using jQuery. I would like the button generated in each row to display a modal with data specific to the items in that particular row. I ...

  1. materialize modal initialize
  2. materialize modal