Can I overlay my own images on a Xamarin Map control? - xamarin

I am using Map (Xamarin.Forms.Maps) to display a Google or Bing map. I need images fed to me from a local tilecache to be rendered on top of the map (opacity of images needs to be respected).
If the map control does not support images to display on top I am thinking I might need to display them on top of the map control through some other element and manually update the tilecache requests when the map is zoomed/panned.
Any ideas for how I should go about adding images with opacity to a Xamarin Map would be appreciated. (I could also support different controls for iOS / Android if necessary)

It's possible but you have to write custom renderers on each of your target platforms:
https://developer.xamarin.com/guides/xamarin-forms/custom-renderer/map/

Related

I'm trying to clip an image overlay in Google Maps API

I'm trying to clip an image overlay in Google Maps API, however without success. I can clip a HTML image successfully and overlay it on a Google MAP by using the CSS clip property and z-index property, however that's no use, as the image does not adjust to the Google map zoom and movements. i.e. the image is not bound to the Google MAP object in any way, doesn't respond to map changes.
If I assign the Google Map overlay to the cropped image source, it simply uses the original un-cropped source and not the cropped page image element. That's just how the image.src property works.
I successfully added an image overlay for Google MAPS, but there does not seem to be any clipping or cropping function for them. There is text on the image that I don't want to display for this application, but I don't want to crop the original source file image, as it's used for multiple display purposes.
historicalOverlay = new google.maps.GroundOverlay(imageurl,imageBounds);
historicalOverlay.setMap(map);
I need imageurl to point to a clipped version in memory or something like that or the clipped form image element, but not its un-clipped source image. Any ideas ?
The GroundOverlay class in Google Maps javascript API V3 does not provide any support for in-browser clipping/cropping of the image before display.
Because we needed that capability, plus some others like image rotation and non-rectangular images, we wrote a GroundOverlayEX javascript class that supports everything that the Google Earth version of GroundOverlay supports, including browser-side clipping/cropping of the image to-be-displayed.
The javascript class is open-source on Github at: https://github.com/azmikemm/GroundOverlayEX. There is API documentation as well (documentation.txt). All images shown by the GroundOverlayEX class are integral to the map, and will drag with the map, and zoom with the map.
A working functional example of the class in-action (with some clipped/ cropped images) is at: https://sites.google.com/site/issearthatnight/
If you turn off the VIIRS checkbox, and set the transparency down to midway, you'll see the images pretty plainly, and see that some are cropped (all are stored in NASA's servers as rectangles, so images that are square-ish or look like slices have been cropped by the GroundOverlayEX class).

Custom elements in watchkit

I was reading Apple Watch Human Interface Guidelines and i'm curious if there is any way in displaying custom UI elements, other than those provided by default by Apple (like tables, buttons or labels). How did they managed to do this:
Did they use images?
While we haven't seen everything that Apple are doing with the core Watch OS apps, it is already clear there are many API functions that they are reserving for their own use at this stage. It's almost certain they were using some of those API functions to create these views.
There is no way to create truly custom UI elements with the current WatchKit API (i.e. entirely new custom classes doing custom drawing). That said, with some creativity, it would be possible to create most of the interface you depict with the current tools available to third party developers. This is almost certainly not the way Apple created it, but you could:
Create a group.
Put inside the group a button with a background image that represents one state of the coloured circle.
At runtime, visually animate the button image as needed by swapping through multiple images that rendered the various states of progress of the circle x colour options. Yes, the starting point would be thinking about 360 images for the circle states x the number of tints. (It is possible to apply a tint to a template image in WatchKit, but as far as I am aware you cannot apply a gradient.)
Add two labels to the group for the large number and subscript, and align both of these to be centred vertically and horizontally in the group.
You can set the tint of the page title at top left by setting the global tint of the application. By changing the global tint at runtime you could change these for each page.
It is not currently possible to change the colour of the page dots at the bottom. These are not set by the global tint and it is not possible currently to change these programatically.
Apple have indicated that later in 2015 third party developers will be able to build fully native apps, but even then, they have not given any indication of whether the API functionality available to us is broader, or whether our API will be essentially the same as it is now, with the one addition that at least some of the current WatchKit App Extension code will be able to run on the device when the iPhone is not present/charged.

How to show part of a map on a Live Tile in WP7?

I'm developing Windows Phone application using Bing maps, background tasks and live tiles. I'd like to show current neighborhood on a live tile (piece of a map). Is it somehow possible to show part of a map on a tile?
I guess instantiating Map object in background task and rendering part of the map as image won't fit into memory requirements.
Maybe there is a web service for returning map image for target coordinates, zoom and image size?
There is indeed a way to do this through the Virtual Earth service. You can read more about it here.
To summarize, you can get a square tile for a specific location just like this:
http://tiles.virtualearth.net/api/GetMap.ashx?c=39.213413,-98.699930&w=800&h=800&b=r,stl.h,device.mobile,mkt.en-US&z=15&logo=no&da=n

How do I set a custom button background for a Metro app for all states

I want to use my own bitmaps for my buttons for a Metro style Windows 8 app. I can set the background brush for a button to my own ImageBrush and that works fine, except for the hover and pressed states. I cannot figure out how to set the bitmaps for them. Does anyone know how to do this?
Thanks.
WinRT XAML Toolkit has an ImageButton control that allows to define images for all states if that is what you need. You can also check its default template in Generic.xaml to see how it uses the bitmaps based on multiple overlaid Image controls (check e.g. PART_HoverStateImage) and visual states that control opacities of these Image controls.
If you are lazy - you can also use just two bitmaps and use semi-transparent bitmap defined using the PressedStateImageSource overlaid on top of the bitmap defined with IdleStateImageSource to show a hover state. Or you can go fully lazy and use just a single bitmap for idle state and let the control generate bitmaps for the other two states by setting GeneratePressedState and GenerateHoverState to true - that generates these bitmaps by "lightening" the idle state image with some basic image processing. The Toolkit also has a sample app with a page that demonstrates the use of the ImageButton control in multiple ways.

J2ME setting textfield over a background image

I am new to J2ME. I just want to know how to put a textfield over a background image. I tried canvas but I can only set the background image and don't know how to add a textfield above the background image. Please help me.
APPROACH I: Using high level api's like Screen, Item, etc
It is NOT feasible in Java ME (CLDC) using high level api's like screens, items, etc are laid out on the display with default device styling and without the extensive layout support like Swing.
APPROACH II: Using low level api's like Canvas
To use the low level api's you need to create custom components like in J4ME. In their you layout the Canvas and paint the components on the top. So in your case you can render the image of the size of Canvas and then render the components on top of it.
NOTE: Please keep in mind this a very tedious and not so rewarding process.
APPROACH III: Use third party library
High Rated UI libraries: LWUIT and J2ME-Polish
SO: JavaME UI Libraries

Resources