thanks for the reply,
here is the code
mapcontrol.js ===>
var side_bar_html = "";
// arrays to hold copies of the markers and html used by the side_bar
// because the function closure trick doesnt work there
var gmarkers = [];
function createMarker1(point, name, address, html,map) {
var marker = new google.maps.Marker({
position: point,
map: map,
title: name
});
var infowindow = new google.maps.InfoWindow({
content: html
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
return marker;
}
function createcenterMarker1(centerpoint, html, map) {
var markerImage1 = new google.maps.MarkerImage({ url: '
http://localhost:9687/sitecontents/25/images/green_MarkerK.png', origin:
centerpoint,anchor:centerpoint });
var centermarker = new google.maps.Marker({
position: centerpoint,
map: map,
title: 'you are here',
icon: markerImage1
});
var centerinfowindow = new google.maps.InfoWindow({
content: html
});
google.maps.event.addListener(centermarker, 'click', function() {
centerinfowindow.open(map, centermarker);
});
return centermarker;
}
// This function picks up the click and opens the corresponding info window
function LoadMap1() {
// ViewPortSize();
// A function to create the marker and set up the event window
// Dont try to unroll this function. It has to be here for the
function closure
// Each instance of the function preserves the contends of a
different instance
// of the "marker" and "html" variables which will be needed later
when the event triggers.
//directionsDisplay = new google.maps.DirectionsRenderer();
// Display the map, with some controls and set the initial location
var latlng = new google.maps.LatLng(mapLatitude, mapLongitude);
var myOptions = {
zoom: mapZoom,
center: latlng,
scrollwheel: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById(mapDivId),
myOptions);
var centerpoint = new google.maps.LatLng(mapLatitude,
mapLongitude);
var centermarker = createcenterMarker1(centerpoint, '<div
style="width:240px">you are here<\/div>', map);
var i = 0;
for (i = 0; i < addressCount; i++) {
var point = new google.maps.LatLng(addresses[i].latitude,
addresses[i].longitude);
var marker = createMarker1(point, addresses[i].name,
addresses[i].addressString, '<div style="width:240px">'+ addresses[i].name
+ '<br />' + addresses[i].addressString + '<\/div>', map);
// map.addOverlay(marker);
}
// directionsDisplay.setMap(map);
if (mapLatitude == '0' && mapLongitude == '0') {
var bounds = new google.maps.LatLngBounds();
var latlngList = new Array(addressCount);
for (i = 0; i < addressCount; i++) {
latlngList[i] = new
google.maps.LatLng(addresses[i].latitude, addresses[i].longitude);
}
var LtLgLen = latlngList.length;
for (var i = 0; i < LtLgLen; i++) {
bounds.extend(latlngList[i]);
}
// Fit these bounds to the map
map.fitBounds(bounds);
}
else {
// var url = '
http://google-maps-icons.googlecode.com/files/library-publ.png';
}
// document.getElementById(addressListDivId).innerHTML =
side_bar_html;
// display a warning if the browser was not compatible
}
On Fri, Jun 11, 2010 at 12:37 PM, Rossko <[email protected]> wrote:
> > please help me out with this issue.
>
> Fix your code or data.
> Can't offer any better advice without seeing the problem.
>
> http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/2b3f101fd509919e#
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.