Google Groups Home
Help | Sign in
Message from discussion Blog Post: 2 lines of code make the world a more beautiful, informational place!
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Andy R  
View profile
 More options Oct 2 2008, 8:45 pm
From: Andy R <andy.ros...@bluewin.ch>
Date: Thu, 2 Oct 2008 05:45:55 -0700 (PDT)
Local: Thurs, Oct 2 2008 8:45 pm
Subject: Re: Blog Post: 2 lines of code make the world a more beautiful, informational place!
There is no 'More' Button. You have to use GLayer.hide() and
GLayer.show(). Look at the examples (custom controls).

And, please don't post code, post a link to your map.

On 2 Okt., 13:47, The Old Man <GrahamSmit...@googlemail.com> wrote:

> Thank you! I have successfully added Panoramio and Wikipedia layers to
> my forum member map at:http://millennium-thisiswhoweare.net/tiwwa/tiwwa_member_map.php

> However, as the layers are enabled by default, the map looks too
> crowded as its zoomed out all the way when first viewed.

> Looking at the public Google Maps page, there is a More button that
> allows visitors to select these layers which is much more friendly.

> To get the layers working, I had to change my map API from v2 to v2.x
> but the MORE button doesn't show.

> How do we enable this? I have the Map, Satellite and Terrain options
> displaying, just need the More button...

> Thanks again,
> Graham

> Here's a section of my code so far:

> function load() {

>         var myPano = new
> GStreetviewPanorama(document.getElementById("pano"));
>         var map = new GMap2(document.getElementById("map"));
>         map.addControl(new GLargeMapControl());
>         map.addControl(new GHierarchicalMapTypeControl());
>         map.addControl(new GOverviewMapControl());
>         map.addControl(new GScaleControl());
>                 map.enableGoogleBar();
>                 map.enableScrollWheelZoom();
>         map.setCenter(new GLatLng(41.902277,-48.867187), 2,
> G_NORMAL_MAP);
>                 map.addMapType(G_PHYSICAL_MAP);

>                 // Add Panoramio and Wikipedia options.

>                 map.addOverlay(new GLayer("com.panoramio.all"));
>         map.addOverlay(new GLayer("org.wikipedia.en"));

>                 // Add streetmap overlay and show the street when available.

>                 svOverlay = new GStreetviewOverlay();
>                 map.addOverlay(svOverlay);
>                 GEvent.addListener(map,"click", function(overlay,latlng) {
>                   myPano.setLocationAndPOV(latlng);
>                 });

>                 // Show a pop with coordinates when someone clicks on the map.

>                 GEvent.addListener(map, 'click', function(overlay, point) {
>         var latLngStr = "<div><h5>You clicked on the map! <br />Copy/
> paste the following numbers into your profile settings <br />to put a
> marker at this exact spot!<br /><br />Lat = " + point.y + "<br />Long
> = " + point.x + "<br />Only enter the numbers, don't include any
> letters!</h5></div>";
>                 map.openInfoWindow(point, latLngStr);

>         });

>         // Download the data in data.xml and load it onto the map.

>         GDownloadUrl("http://millennium-thisiswhoweare.net/tiwwa/
> membermap_xml/data.xml",function(data) {
>           var xml = GXml.parse(data);
>           var markers = xml.documentElement.getElementsByTagName("marker");
>           for (var i = 0; i < markers.length; i++) {
>                 var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
>                                                 parseFloat(markers[i].getAttribute("lng")));

>                 var displayname = markers[i].getAttribute("displayname");
>         var title = markers[i].getAttribute("title");
>         var posts = markers[i].getAttribute("posts");
>                 var msg = markers[i].getAttribute("msgtotal");
>                 var views = markers[i].getAttribute("profileviews");
>                 var topics = markers[i].getAttribute("topics");
>                 var type = markers[i].getAttribute("type");
>                 var userid = markers[i].getAttribute("userid");
>         var html = "<div><h5>" + displayname + "<br />" + title + "</
> h5><div id=\"profile_link\"><a href=\"/tiwwa/index.php?showuser=" +
> userid + "\" title=\"View " + displayname + "'s full social profile
> page.\">View " + displayname + "'s Profile.</a></div><h5>Total Posts:
> " + posts + "<br />Total Topics: " + topics + "<br />Total Stored
> PM's: " + msg + "<br />Profile Views: " + views + "<br /><br />Map Lat/
> Lng: " + point + "</h5></div>";

>                 var html= html;

>           // create the marker
>                 var marker = createMarker(point,displayname,type,html);
>                 map.addOverlay(marker);          }
>           // put the assembled sidebar_html contents into the sidebar div
>           document.getElementById("sidebar").innerHTML = sidebar_html;


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google