<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gaunt Face &#124; Matthew Gaunt &#187; Widgets</title>
	<atom:link href="http://www.gauntface.co.uk/blog/tag/widgets/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gauntface.co.uk/blog</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Tue, 31 Jan 2012 23:21:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>MapView with Widgets Android</title>
		<link>http://www.gauntface.co.uk/blog/2010/01/04/mapview-with-widgets-android/</link>
		<comments>http://www.gauntface.co.uk/blog/2010/01/04/mapview-with-widgets-android/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 23:38:55 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[MapView]]></category>
		<category><![CDATA[Widgets]]></category>

		<guid isPermaLink="false">http://www.gauntface.co.uk/blog/?p=398</guid>
		<description><![CDATA[This phased me for quite sometime, how do I use a widget like a button, or a view as an overlay? I asked on the Google Groups, got a great reply from Mark Murphy, and he explained about how you can use relative layouts to add views on top of the map view and set [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-medium wp-image-209  aligncenter" title="androidLogo" src="http://www.gauntface.co.uk/blog/wp-content/uploads/2009/08/androidLogo-300x166.png" alt="" width="300" height="166" /></p>
<p>This phased me for quite sometime, how do I use a widget like a button, or a view as an overlay?</p>
<p>I asked on the Google Groups, got a great reply from Mark Murphy, and he explained about how you can use relative layouts to add views on top of the map view and set x, y coordinates and use z ordering.</p>
<p>I started to think about what the MapView was, then a quick look at the API and bam, addView.</p>
<p><span id="more-398"></span></p>
<p>So here&#8217;s how you add a view to a MapView and I&#8217;m sure you can add buttons to it etc</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">LinearLayout  v = (LinearLayout) View.inflate(getApplicationContext(), R.layout.markerlayout, null);<br />
TextView markerTextView = (TextView) v.findViewById(R.id.MarkerTextView);<br />
markerTextView.setText(&quot;Example Text&quot;);<br />
_mapView.addView(v, 0, new MapView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, new GeoPoint((int) (latitudeVariable * 1E6), (int) (longitudeVariable * 1E6)), MapView.LayoutParams.BOTTOM_CENTER));</div></div>
<p>The LayoutParams is the key to defining where the marker view is kept in relation to the map.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gauntface.co.uk/blog/2010/01/04/mapview-with-widgets-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

