Change position of a circle? - google-maps-api-3

I want a circle object to change position, I would imagine that I do the same as I do with markers -
marker.setPosition(latlng);
So -
circle.setPosition(latlng);
But this doesn't work. The marker changes position, but the circle doesn't. All I can find is this link - https://developers.google.com/maps/articles/mvcfun
Would that seem like the best way to go about this? I've not had a proper ready through it, so I'm going to try implement the above.

You need to change the center property of the circle to move it (it doesn't have a position property)
circle.setCenter(latlng)
https://developers.google.com/maps/documentation/javascript/reference#Circle

Just an extension for above answer
MyLocationCircle.setCenter(new google.maps.LatLng(latitude, longitude));

Related

How to bind Circle CenterX and Slider Value

Got problem when I tried to bind a slider with a circle centerX, and don't know how to solve it... So the ball has to go from left to right, with an animation(i guess that an animation is the best solution for that) and the slider has to return the ball somewhere in the scene, but the slider doesn't follow the movement of the ball while the animation is playing... Any help is appreciated.
In order to bind two values together you need to use bindBidirectional method instead of bind. Also when you put a node in a container like the BorderPane it layouts the children based on some rules. If you want to manage the position of the circle yourself you will have to specify the intention with cr.setManaged(false).

Tree dataTipFunction tooltip Change position,Flex3

I am doing dataTipFunction on Tree in Flex3 Air,
At present the tooltip hides the present node, i need to reposition the tooltip above the node, how can change the x,y position of the tooltip.
Thanks in Advance
The way I did this was to add the toolTipShown listener on the tree itemRenderer, not on the tree. I have a blog post that shows you how to do it, including the code for positioning the tooltip below or above the node.
Hook into the tooltipShow event on the Tree and move the tooltip yourself (a reference to the tooltip is in the event)
tooltipShow
You might need to do a bit of logic to position it correctly, and you'll probably want to check if repositioning it would move it off screen and move it below instead in that case.

Drawing a rectangle on a flex canvas is there a better way than

To draw a "selection rectangle" from the mouse down , mouse move then remove it on mouse up i currently do the following:
My board is a canvas,
On mouse down i create a new UIcontainer i set his borders.
I update his width and height related the the mouse move position,
on mouse up i remove this child UIcontainer.
Do i have to create a new component for this kind of task or there is a better (lighter way) in flex ?
Thanks,
Here is an Flex selection rectangle example, although I think it won't be a better/lighter way, perhaps you can get some nice ideas from it.
I'd say you got it right.

How can I float a movieclip over a textarea to make it appear like it's part of the text?

Take a look at this demo, how do they accomplish the Inline Changes feature? To me it looks like they are floating a movieclip over the textarea.
What I can't figure out is how they anchored the movieclip to stay in the correct position. If you type something before the movieclip it moves position along with the text, the movieclips even move to the next line when the text word wraps. Does anyone have an idea?
What I think they're doing is keeping track of the index the sprite is representing. Then they have a nice function that moves the sprite to the correct position given the size of the textbox and font. All you need to do after that is bind the positioning function to changes made to the textbox and you've got that effect. Doesn't seem too complicated, as there are already font size/position functions available.
EDIT: Notice how you cannot type code in between the overlapping regions.

Any advice on 'breaking' an object out of its layout in Flex - for animation purposes?

If I have an object in a layout in Flex what is a good way to 'break it out' of that layout to be able to animate it.
For instance I have an image and a caption arranged at an angle. I want to make the image 'zoom out' slightly when the mouse rolls over it. Since its in a layout container is active if I were to resize it then obviously it would move around everything else.
I dont think I can achieve what I want by just setting includeinlayout=false.
Any experience with best practices on this?
My best idea I'm wondering about is making the image invisible and creating another image at the same location by using the screen coordinate conversion functions. This jsut semes clumsy
Wrap your object in a fixed size Canvas so that the layout upstream will remain the same. Then position the object manually within that container and then set its includeInLayout to false. At that point, you could do whatever you wanted with the interior object. Oh, also set clipContent to false. This should work whether you want it to grow or shrink.
If this is an itemrenderer or something that you've wrapped into a class, you could handle all of this in the class definition and make it transparent to consumers of the object. You'd also be able to write a mouseOver function that did what you wanted with the interior object that should zoom.

Resources