rich:virtualEarth location marker?
kwutzke Jun 8, 2011 6:57 PMHello,
I have implemented a simple rich:gmap showing a marker of the current location:
{code}
<rich:gmap gmapVar="arenaGmap#{_postAddress.ordinalNbr}" | |
gmapKey="lalalalalalalalala............" | |
lat="#{_postAddress.latitude}" | |
lng="#{_postAddress.longitude}" | |
mapType="G_HYBRID_MAP" | |
style="margin: 0px auto; width: 100%; height: 500px" /> | |
<script type="text/javascript"> |
window.onload = function()
{
arenaGmap#{_postAddress.ordinalNbr}.addOverlay( | |
new GMarker(new GLatLng(#{_postAddress.latitude}, | |
#{_postAddress.longitude})) | |
); |
}
</script> |
{code}
I was trying the same for rich:virtualEarth, following the example at http://blogs.msdn.com/b/keithkin/archive/2007/04/28/virtual-earth-api-simple-veshapelayer-example.aspx:
{code}
<rich:virtualEarth var="arenaVemap#{_postAddress.ordinalNbr}" | |
lat="#{_postAddress.latitude}" | |
lng="#{_postAddress.longitude}" | |
mapStyle="Hybrid" | |
dashboardSize="Normal" | |
style="margin: 0px auto; width: 100%; height: 500px" /> | |
<script type="text/javascript"> |
window.onload = function()
{
var shapeLayer = new VEShapeLayer(); | |
shapeLayer.AddShape(new VEShape(VEShapeType.Pushpin, new VELatLong(#{_postAddress.latitude}, #{_postAddress.longitude}))); |
arenaVemap#{_postAddress.ordinalNbr}.AddShapeLayer(shapeLayer); |
}
</script> |
{code}
But the pushpin isn't shown. In Firefox I get an error saying:
{code}
Error: VE_MapDispatch_SymbolLib is null
Source: http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1
Line: 149
{code}
IE 8 doesn't show the pin either (same error text).
The code causing the error is:
{code}
if ( g == VEShapeType.Pushpin )
b.symbol = VE_MapDispatch_SymbolLib.GetMapSymbolByID(MC_PROPERTY_PUSHPIN);
{code}
Looks like some JS file missing when trying to look up the pushpin graphic object from a "symbol lib".
Can anyone help? How can I make it work?
Karsten
PS: Is there a preview view when posting available here anywhere? I can't find it.