Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.
This repository was archived by the owner on Nov 30, 2018. It is now read-only.

Change location of circles on map through code #1271

@jjbskir

Description

@jjbskir

Hey, I was able to draw a circle perfectly with this code, but when I went to dynamically change the circle's center later on through code I was not able to unless I also changed the circles radius. Is this a bug or meant to be?

My code to initialize the circle:

<ui-gmap-circle center='circle.center'
            radius='circle.radius'
            fill='circle.fill'
            stroke='circle.stroke'
            clickable='circle.clickable'
            draggable='circle.draggable'
            editable='circle.editable'
            visible='circle.visible'
            events='circle.events'>
        </ui-gmap-circle>
    $scope.circle = {
        id: 1,
        center: {
            latitude: centerLat,
            longitude: centerlon
        },
        // radius in meters
        radius: 50,
        stroke: {
            color: '#08B21F',
            weight: 2,
            opacity: 1
        },
        fill: {
            color: '#08B21F',
            opacity: 0.5
        },
        geodesic: true, // optional: defaults to false
        draggable: true, // optional: defaults to false
        clickable: true, // optional: defaults to true
        editable: true, // optional: defaults to false
        visible: true, // optional: defaults to true
        control: {}, 
        events: {
            radius_changed: function(googleCircle, eventName, circle) {
            }, 
            center_changed: function(googleCircle, eventName, circle) {
            }
        }
    };

What did not change the circles center location on the map:

$scope.circle['center'] = newCords;

What did work:

$scope.circle['center'] = newCords;
$scope.circle['radius'] = $scope.circle['radius'] + 1;

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions