I put the following code in a content webpart and though the space for the div tag is given the map doesnt render.


Code Block

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src=" =5"></script>
<script language="javascript" type="text/javascript" >
var map = null;
var Marks = [];

function userobject(pName, pComments){
this.Name = pName
this.Comments = pComments

function AddPushpin()
var shape = new VEShape(VEShapeType.Pushpin, map.GetCenter());
shape.SetTitle('My pushpin');
shape.SetDescription('This is shape number ');

function GetMap()
//Dispose the map if it was previously loaded.
if (map!=null){

for(i = 0; i < 4; i++){
Marks[i] = new userobject("object " & i, "comment " & i);

map = new VEMap('myMap');
map.LoadMap(new VELatLong(37.8225, -122.17822),12,'r',false,VEMapMode.Mode2D,false);
var tileSourceSpec = new VETileSourceSpecification("tilelayer", " g=%6&shading=hill");
tileSourceSpec.MinZoomLevel = 1;
tileSourceSpec.NumServers = 1;
tileSourceSpec.MaxZoomLevel = 18;
tileSourceSpec.Opacity = 1.0;
tileSourceSpec.ZIndex = 1;
map.AddTileLayer(tileSourceSpec, true);

// map.LoadMap(new VELatLong(37.8225, -122.17822),16,'a',false, VEMapMode.Mode3D,false);
// map.SetPitch(-33);
// if (map != null){
// map.Dispose();
// }
// map = new VEMap('myMap');
// // map.HideDashBoard();
// // map.SetDashboardSize(VEDashboardSize.Small);
// map.LoadMap(new VELatLong(37.8225, -122.17822),16,'a',false, VEMapMode.Mode3D,false);
// map.SetPitch(-33);

<body onload="GetMap();">
<div id='myMap' style="position:relative; width:525px; height:400px;"></div>


Re: SharePoint - Development and Programming Live Search not rendering


I am having a similar problem. What I think the problem is, is that body onload = "GetMap()" does not invoke the j script. Try putting in a window.alert at the top of your GetMap function. You will see that window.alert does not fire. I need a way to invoke J Script in a web part to change the img src. Similar to what you are doing with id='myMap'.

If anyway know how to invoke the J script in the body onload, please let us know. If you put this into a htm page and not a web part, it works fine.

Re: SharePoint - Development and Programming Live Search not rendering


I figured it out. Right after your <script language="javascript" type="text/javascript" > line, place the follwing line:


Get rid of your body onload="GetMap()". Loading a jscript function in the body onload will not work. See attached link as to why q=cache:8tcIWSWuUXwJTongue

Hope this helps. I wasted an entire day trying to figure this out.