I am using Google Maps for a weather information display web.
I want to show the cloud condition for past seven days.
I am using overlays to display clouds on my web.
Now my question is can we change image of google.maps.GroundOverlay using javascript?
I believe it is not possible to change the image of a GroundOverlay. The image is set in the constructor and there is currently no setter documented to change it.
What you could try is to create two GroundOverlays with the same coordinates but pass the constructor map:null on one of them so it doesn't show on your map. Then, when you want to replace the image, call setMap(null) on the overlay that is showing--that will hide it--and then call setMap(map) (assuming you set your map to a variable named map) on the overlay that you want to show.
There's currently no way to change GroundOverlay's image via maps API. Instead, create new GroundOverlay with the same bounds for the new image. And remove the original GroundOverlay.
This has changed from 2011.
In Google Maps API V3, GroundOverlay class extends MVCObject which has getters and setters.
So you can indeed change image of ground overlay with overlay.set("url", newImage). Similarly, you can change overlays bounds with overlay.set("bounds",bounds).
After changing overlay properties, you have to reassign the map object to it with overlay.setMap(map).
Related
I'm fiddling around with ti.barcode scanner module, but it seems it's always fullscreen.
Is there a way to make it use a part of the screen?
For iOS you can use SquareCamera: https://github.com/mikefogg/SquareCamera which allows you to have the camera inside a view and scan qr codes too.
But if you want to have it cross platform I would go with the overlay variant
Not sure if you can embed the ti.barcode to a smaller view, since you don't add it to a controller.
Have you tried to set the size of the module in the capture method?
The possible workaround is to create a view with your stuff and place it in the overlay property of the capture method
I have gameObject with animator attached to it, it has animation curves, I need to dynamically change keyframe values from code. How do I access them?
Already asked this in the Live Session. The Answer is you can't since the anim file is the core for running the Animation Controller.
The alternate way that they gave me is to use the legacy SpriteRenderer instead.
Animation Controller doesn't support Dynamic changing of the values. Instead they provided Animator for you to make Dynamic changes of path from anim files, so consider making different anim files and path to your Animator if you don't like to work with SpriteRenderer.
If "dynamically" still means editor-time, then you could use UnityEditor.AnimationUtility, which provides methods to get and set curves and key frames and more.
One can retrieve the bindings with AnimationUtility.GetCurveBindings() or AnimationUtility.GetObjectReferenceCurveBindings(). And with AnimationUtility.GetObjectReferenceCurve() one can get the key frames, make modifications and apply it with AnimationUtility.SetObjectReferenceCurve()
At runtime - probably only with workarounds.
For example via some animated relay value within a certain custom script that then applies the wanted value to the actual property on Update() - a kind of custom constraint if you will. And within that you could apply then again custom modifications via code on runtime. But on editor time and when animating, the preview would be broken because you would not directly animate the property, but only that relay value. Maybe one could use [ExecuteInEditMode] in that custom constraint behaviour and AnimationMode.InAnimationMode() to simulate a preview. But all of this would be experimental.
I'd like to append a border (20px white) to an image, save as a new jpeg image (orginal image with a border), I don't know how do I start. Can anyone give me a direction or code example?
Thanks
You have two ways to do it:
On your UI, wrap the image with a Border element with the correct settings and use new WriteableBitmap(borderElement, null) to create a new WriteableBitmap which you can then save using the SaveJpeg extension method.
Your other option is to use the WriteableBitmapEx class library to graphically add the graphical elements you want.
I've used both. The advantages for (1) is that there's less hassle in the sense of adding a dependeny on another DLL. The advantage in (2) is that you don't need to mess with your UI to create the image.
I am building an Eclipse RCP application, based on eclipse 3.5.
I'd like to modify an image at runtime. The image is loaded and will be used as an icon, but depending on the situation, I'd like to add a filter on the image to give it a red or orange color, depending on some user-configured value.
It's the image transformation that I'm interested in. I already know how to get the image and ask a component to display it.
Has anybody done that? Thanks for your help :)
There are possibly many choices for doing just that, you can use ImageIO to load an image as BufferedImage and then get the Graphics2D and modify it as you wish. When you are finished modifying you can reaasign the newly created image back into your component which holds the original image and thats it.
You can of course look for some libraries to allow you easier image manipulation, maybe jmagick or something similar.
You can use DecoratingLabelProvider with a suitable ILabelDecorator. See also FAQ What is a label decorator?
This is my scenario in brief:
I am making a restaurant's website.
The restaurant owner will upload his restaurant's plan view image.(example: http://cache.smartdraw.com/examples/content/Examples/SmartDraw/Floor_Plans/Restaurant_Plans/Family_Restaurant_Plan_L.jpg) Then he will mark on the image were the tables available for booking are. These coordinates will be saved in my database.
The user on the other hand will be able to click on these points(tables) and book a table.
The image map coordinates will be created dynamically according to the points that were submitted by the restaurant owner. Therefore I cannot have an image with icons already on it.
Is there a way with which I can display some sort of icon on the image map where the coordinates are? In order to make the points visible for the user.
I can think of a few options:
Generate the image map on your server, using something like GD for PHP, and place the icons where you want them
Use Javascript/CSS to position the icons where you want the in the HTML page
Use Flash to dynamically generate the icons
I think you can use ItemizedOverlay in this case.