Hyperlink to a specific kml marker, through the rss item?

308 views
Skip to first unread message

Christopher Watson

unread,
Feb 24, 2011, 5:25:57 AM2/24/11
to google-map...@googlegroups.com
OK, i have fetched a load of markers from a kml feed to display. Can i link outside the google map on the same html web page to specific location markers in the google map?

so when i click a link on my web page, it highlights/reioreintates to show you a specific pin in the google map, but still at the same web page?

can i create a hyperlink to one of these somehow that are inside the rss feed? does the <guid isPermaLink="false"> need to be true and can i change it?

  <item>
<guid isPermaLink="false">00049cd1c945a557766d1</guid>
<pubDate>Mon, 21 Feb 2011 21:45:45 +0000</pubDate>
    <title>Natural History Museum of Los Angeles County</title>
<description><![CDATA[]]></description>
<author>visualthinkmap</author>
<georss:point>
34.017284 -118.288795
</georss:point>
<georss:elev>0.000000</georss:elev>
</item>
  <item>
<guid isPermaLink="false">00049cd1c9f8a34fdce5e</guid>
<pubDate>Mon, 21 Feb 2011 21:45:57 +0000</pubDate>
<title>Museum of Neon Art</title>
<description><![CDATA[]]></description>
<author>visualthinkmap</author>
<georss:point>
      34.048370 -118.247589
</georss:point>
<georss:elev>0.000000</georss:elev>
</item>

<a href="http://... ...what can i put here?... ..." id="map_canvas">Natural History Museum</a>

i know this is wrong, its to hint at what i'd like to achieve.

heres how my map is working at the minute. http://visualisationmagazine.com/lacreativemap.htm

if i can explain anything more clearer please ask.

hope you can help, thanks

chris
 

geoco...@gmail.com

unread,
Feb 24, 2011, 6:16:23 AM2/24/11
to Google Maps JavaScript API v3
On Feb 24, 5:25 am, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> OK, i have fetched a load of markers from a kml feed to display. Can i link
> outside the google map on the same html web page to specific location
> markers in the google map?
>
> so when i click a link on my web page, it highlights/reioreintates to show
> you a specific pin in the google map, but still at the same web page?

You mean something like this?
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.html?filename=visualisationmagazine_com_lacreativemap_kml.xml

KmlLayer doesn't give access to the markers to do that (yet).

>
> can i create a hyperlink to one of these somehow that are inside the rss
> feed?

What rss feed? This is a kml feed.

-- Larry

> does the <guid isPermaLink="false"> need to be true and can i change
> it?
>
>   <item>
>     <guid isPermaLink="false">00049cd1c945a557766d1</guid>
>     <pubDate>Mon, 21 Feb 2011 21:45:45 +0000</pubDate>
>
>     <title>Natural History Museum of Los Angeles County</title>
>     <description><![CDATA[]]></description>
>     <author>visualthinkmap</author>
>     <georss:point>
>       34.017284 -118.288795
>     </georss:point>
>     <georss:elev>0.000000</georss:elev>
>   </item>
>
>   <item>
>     <guid isPermaLink="false">00049cd1c9f8a34fdce5e</guid>
>     <pubDate>Mon, 21 Feb 2011 21:45:57 +0000</pubDate>
>     <title>Museum of Neon Art</title>
>     <description><![CDATA[]]></description>
>     <author>visualthinkmap</author>
>     <georss:point>
>
>       34.048370 -118.247589
>     </georss:point>
>     <georss:elev>0.000000</georss:elev>
>   </item>
>
> <a href="http://... ...*what can i put here?*... ..."
> id="map_canvas">Natural History Museum</a>
>
> i know this is wrong, its to hint at what i'd like to achieve.
>
> heres how my map is working at the minute.http://visualisationmagazine.com/lacreativemap.htm

Christopher Watson

unread,
Feb 24, 2011, 6:33:19 AM2/24/11
to google-map...@googlegroups.com
hi larry,

yes like that. so that there is a hyperlink and it highlights the pin with the info window.

can those links on the right of your test:

'You mean something like this?
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.html?filename=visualisationmagazine_com_lacreativemap_kml.xml

can i place those links where i want to? at the bottom of my page.


Christopher Watson

unread,
Feb 24, 2011, 6:38:12 AM2/24/11
to google-map...@googlegroups.com
so the links are underneath my map, alongside other html content i have like i have here:

http://visualisationmagazine.com/lacreativemap.htm

could i load just the links where i want them?

Christopher Watson

unread,
Feb 24, 2011, 6:52:17 AM2/24/11
to google-map...@googlegroups.com

Can I display the markers address details too? Underneath each link.



--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScr...

geoco...@gmail.com

unread,
Feb 24, 2011, 9:10:19 AM2/24/11
to Google Maps JavaScript API v3
On Feb 24, 6:52 am, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> Can I display the markers address details too? Underneath each link.

You can do whatever you want. That example is using the third party
kml parser geoxml3:
http://code.google.com/p/geoxml3/

If the information is available in the xml (kml), you can display it,
geoxml3 has a "default" behavior, but hooks to allow you to do what
you want.

That example makes the "sidebar" on the right side, you can put that
div where you want it and format it however you like.

-- Larry

>
> On 24 Feb 2011 11:38, "Christopher Watson" <chris.watso...@googlemail.com>

Christopher Watson

unread,
Feb 24, 2011, 9:48:46 AM2/24/11
to google-map...@googlegroups.com

How can I see what data is available in the kml, such as the address?

Is there a list? Documentation to kml and calling using geoxml3?

Is it what's in the item when I view the kml feed? In there are the lat lng numbers of the marker, can they convert to a postal address.

Also sounds bad, true novice/beginner to kml, how can I 'hook' this data in the kml using geoxml3?

Any help is much appreciated

Thx

On 24 Feb 2011 14:10, "geoco...@gmail.com" <geoco...@gmail.com> wrote:

On Feb 24, 6:52 am, Christopher Watson <chris.watso...@googlemail.com>
wrote:

> Can I display the markers address details too? Underneath each link.

You can do whatever you want.  That example is using the third party
kml parser geoxml3:
http://code.google.com/p/geoxml3/

If the information is available in the xml (kml), you can display it,
geoxml3 has a "default" behavior, but hooks to allow you to do what
you want.

That example makes the "sidebar" on the right side, you can put that
div where you want it and format it however you like.

 -- Larry

>
> On 24 Feb 2011 11:38, "Christopher Watson" <chris.watso...@googlemail.com>

> wrote:
>
> so the links are underneath my map, alongside other html content i have like

> i have h...

You received this message because you are subscribed to the Google Groups "Google Maps JavaScript AP...

Christopher Watson

unread,
Feb 24, 2011, 9:54:43 AM2/24/11
to google-map...@googlegroups.com

Would I use this 'hook' somehow?

markerOptions

On 24 Feb 2011 14:48, "Christopher Watson" <chris.w...@googlemail.com> wrote:

How can I see what data is available in the kml, such as the address?

Is there a list? Documentation to kml and calling using geoxml3?

Is it what's in the item when I view the kml feed? In there are the lat lng numbers of the marker, can they convert to a postal address.

Also sounds bad, true novice/beginner to kml, how can I 'hook' this data in the kml using geoxml3?

Any help is much appreciated

Thx


>
> On 24 Feb 2011 14:10, "geoco...@gmail.com" <geoco...@gmail.com> wrote:
>

> On Feb 24, 6:52 ...

geoco...@gmail.com

unread,
Feb 24, 2011, 10:15:05 AM2/24/11
to Google Maps JavaScript API v3
On Feb 24, 9:48 am, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> How can I see what data is available in the kml, such as the address?

A copy of your kml (geoxml3 is subject to the XmlHttp same-domain
restriction, so I put a copy of it on my server):
http://www.geocodezip.com/geoxml3_test/visualisationmagazine_com_lacreativemap_kml.xml

You can read it and see what information it contains (looks like name
and description, with description sometimes empty).

>
> Is there a list? Documentation to kml:
http://code.google.com/apis/kml/documentation/kmlreference.html


> and calling using geoxml3?
Documentation on that is a little light, but I already provided this
link:
http://code.google.com/p/geoxml3/


>
> Is it what's in the item when I view the kml feed? In there are the lat lng
> numbers of the marker, can they convert to a postal address.

That is called "reverse geocoding". If you know the actual address
and the geographic coordinates (lat/lng), that is better, both
geocoding (converting an address to coordinates) and reverse geocoding
(converting coordinates to an address) have inaccuracies.

>
> Also sounds bad, true novice/beginner to kml, how can I 'hook' this data in
> the kml using geoxml3?

There is a hook for an xml parsing function, which can be used to
parse additional elements out of the kml, not particularly well
documented. Example here:
http://www.geocodezip.com/geoxml3_test/votemap_address2.html

-- Larry

>
> Any help is much appreciated
>
> Thx
>
Message has been deleted

Christopher Watson

unread,
Feb 24, 2011, 5:42:58 PM2/24/11
to google-map...@googlegroups.com
thanks for the really good links etc larry, but i feel like i'm tumbling down a hole.

i'm trying to test your http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.html?filename=visualisationmagazine_com_lacreativemap_kml.xml

on my own server, but where, how did you turn my kml link: http://maps.google.co.uk/maps/ms?hl=en&ie=UTF8&msa=0&output=kml&msid=206079082473829003186.00049cd1c36181375a3f8

into a xml? cant see it in the code, it looks like you did from browser... .html?filename=
visualisationmagazine_com_lacreativemap_kml.xml
 
where's this file off of my server to link to it: visualisationmagazine_com_lacreativemap_kml.xml

i was just going to move the div, but i cant load my markers/kml thorugh the xml.

how do i turn my kml feed into a xml? and then link to it to do your example of the sidebar links?

been looking all through the kml documentation and geoxml3 examples and yours, i 'copy pasted' from source code but where do you convert or load my kml? where is this file? will keep looking but if you point it out to me would be very helpful.

can usually get examples to work from copy paste and tweak as little as i need too.

thx

geoco...@gmail.com

unread,
Feb 24, 2011, 6:16:04 PM2/24/11
to Google Maps JavaScript API v3
On Feb 24, 5:42 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> thanks for the really good links etc larry, but i feel like i'm tumbling
> down a hole.
>
> i'm trying to test your
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.htm...
>
> on my own server, but where, how did you turn my kml link:http://maps.google.co.uk/maps/ms?hl=en&ie=UTF8&msa=0&output=kml&msid=...
>
> into a xml?

I downloaded it from your site and put it on my server. geoxml3 is
subject to the same domain security restriction on XmlHttpRequest, so
it was either that or use a proxy (and geoxml3 doesn't have built in
support yet for a proxy).

The file itself is here on my server:
http://www.geocodezip.com/geoxml3_test/visualisationmagazine_com_lacreativemap_kml.xml

-- Larry

> cant see it in the code, it looks like you did from browser...
> .html?filename=
> visualisationmagazine_com_lacreativemap_kml.xml
>
> where's this file off of my server to link to it:
> visualisationmagazine_com_lacreativemap_kml.xml
>
> i was just going to move the div, but i cant load my markers/kml thorugh the
> xml.
>
> *how do i turn my kml feed into a xml?* and then link to it to do your

Christopher Watson

unread,
Feb 26, 2011, 2:15:14 PM2/26/11
to google-map...@googlegroups.com
hi larry,

success, i have got it to load and work on my server, yay! http://visualisationmagazine.com/test2.htm

i followed your example here: http://www.geocodezip.com/geoxml3_test/votemap_address2.html

but cant quite see where/how to display the address details from the marker. this is the way i'm trying to parse... it!

i appeded in to the var name as... i try not to change it too much (relpaced 'name' with 'point', pointy becasue the kml ref page said to use point if thats whats in your xml.

function makeSidebarEntry(i) {
  var name = geoXmlDoc.placemarks[i].name;
   if (!name  || (name.length == 0)) name = "marker #"+i;
   // alert(name);
   sidebarHtml += '<tr id="row'+i+'"><td><a href="javascript:kmlClick('+i+');">'+name+'</a></td></tr>';
 
 var point = geoXmlDoc.placemarks[i].point;
   if (!point  || (point.length == 0)) point = "geoXmlDoc.placemarks[i].address"+i;
   // alert(point);
   sidebarHtml += '<tr id="row'+i+'"><td onmouseover="kmlHighlightPoly('+i+');" onmouseout="kmlUnHighlightPoly('+i+');">'+point+' - <a href="javascript:kmlShowPlacemark('+i+');">hide other pins</a></td></tr>';
}

it seems if i had "marker #" it showed marker on my page. now with the bold part that i put there it shows a number. how is it going wrong? i get lost looking at the polling page.


secondly,

i moved the div to underneath, but how can i make it spill into 4 columns rather than create a scroll bar? i looked up the div attribute, but i've never come accross a column attribute in div.

any help is much appreciated

oh, larry can you paste the url path to my kml file for the la map. i downloaded it from your server, i cant see the file on my server. i didnt upload one and there isnt one displayed? may sound daft but dont know where you got that file off my server. the url path to it will help when i try to replicate this map to others.

you've been very helpful. thx

geoco...@gmail.com

unread,
Feb 26, 2011, 3:23:32 PM2/26/11
to Google Maps JavaScript API v3
On Feb 26, 2:15 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> hi larry,
>
> success, i have got it to load and work on my server, yay!http://visualisationmagazine.com/test2.htm
>
> i followed your example here:http://www.geocodezip.com/geoxml3_test/votemap_address2.html
>
> but cant quite see where/how to display the address details from the marker.
> this is the way i'm trying to parse... it!

The key to that example is this section:
// Custom placemark parse function
function parsePlacemark (node, placemark) {
var addressNodes = node.getElementsByTagName('address');
var address = null;
if (addressNodes && addressNodes.length && (addressNodes.length
> 0)) {
placemark.address = geoXML3.nodeValue(addressNodes[0]);
}
}

it is run during the xml parsing and adds the .address attribute to
the placemark object. So what you need to do is look at your xml and
add an address element to the placemark

>
> i appeded in to t he var name as... i try not to change it too much (relpaced
> 'name' with 'point', pointy becasue the kml ref page said to use point if
> thats whats in your xml.

What are you trying to do? If you are trying to display the address
details, where are they in your xml?
I see address information in the description tag for the placemark
with <name>Time Travel Mart</name>
in my copy of your kml.

If they are in the description tag, that is already parsed out into
the placemark object.

>
> function makeSidebarEntry(i) {
>   var name = geoXmlDoc.placemarks[i].name;
>    if (!name  || (name.length == 0)) name = "marker #"+i;
>    // alert(name);
>    sidebarHtml += '<tr id="row'+i+'"><td><a
> href="javascript:kmlClick('+i+');">'+name+'</a></td></tr>';
>
>  var point = geoXmlDoc.placemarks[i].point;
>    if (!point  || (point.length == 0)) point = "*
> geoXmlDoc.placemarks[i].address*"+i;
>    // alert(point);
>    sidebarHtml += '<tr id="row'+i+'"><td
> onmouseover="kmlHighlightPoly('+i+');"
> onmouseout="kmlUnHighlightPoly('+i+');">'+point+' - <a
> href="javascript:kmlShowPlacemark('+i+');">hide other pins</a></td></tr>';
>
> }
>
> it seems if i had "marker #" it showed marker on my page. now with the bold
> part that i put there it shows a number. how is it going wrong? i get lost
> looking at the polling page.
>
> secondly,
>
> i moved the div to underneath, but how can i make it spill into 4 columns
> rather than create a scroll bar? i looked up the div attribute, but i've
> never come accross a column attribute in div.

I would make an html table with 4 columns and put 4 separate "sidebar"
divs there (but I am a little old fashioned with my html).

>
> any help is much appreciated
>
> oh, larry can you paste the url path to my kml file for the la map. i
> downloaded it from your server, i cant see the file on my server. i didnt
> upload one and there isnt one displayed? may sound daft but dont know where
> you got that file off my server. the url path to it will help when i try to
> replicate this map to others.

You had a reference to it in your original map. Where is that now?
It may have been a reference to your google "MyMap", I can't recall
(that would work with KmlLayer, but not with geoxml3, at least not
yet).

-- Larry

Christopher Watson

unread,
Feb 26, 2011, 6:12:08 PM2/26/11
to google-map...@googlegroups.com
see i thought just create 4 colums using good old html but how can i spill the div? there isnt any attribute that will make it spill into another div. can the spill be done through kml or php, css looked like the like option? i cant spill into other divs. can the kml that makes the sidebar overflow into other div id's?

<tr><td colspan="2">      
      <table border="1" width="100%">    
        <tr>
        <td><div id="sidebar" style="width:200px;height:600px;"></div></td>
        <td><div id="sidebar" style="width:200px;height:600px;"></div></td>
        <td><div id="sidebar" style="width:200px;height:600px;"></div></td>
        <td><div id="sidebar" style="width:200px;height:600px;"></div></td>   
        </tr>   
      </table>    
</td></tr>

i've never seen it automatically spill, or div's be linked.

can i specify so many placemarkers per div / id?

this make sense?

geoco...@gmail.com

unread,
Feb 26, 2011, 6:32:54 PM2/26/11
to Google Maps JavaScript API v3
On Feb 26, 6:12 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
It has come up before in the v2 group.

Quick and dirty example:
http://www.geocodezip.com/geoxml3_test/visualisationmagazine_com_geoxml3_mapA.html
(not particularly well tested).

-- Larry

Christopher Watson

unread,
Feb 26, 2011, 8:05:50 PM2/26/11
to google-map...@googlegroups.com
chnaged the xml source to test on my server. your link worked straight away in firefox. refreshed it and it didnt show them again, is the cache.

any how mine didnt work any time i tested. so eventually thought maybe its the browser.

IE showed mine working straight away, but it doesnt like a refresh. doesnt show them in the 4 columns after a refresh. not had it work straight away in firefox.

but it your link worked straight away in firefox.

thought i'd feedback that it sort of worked the 'quick and dirty'.

i did keep clearing my firefox browser cache to test it btw.

anyhow, its sort of working for now, better than what i have, thx.

now I will crack on with trying to find a way that displays the descriptions to get the address

and lastly tyring to make my overlay in the previous approach with kmllayer, http://visualisationmagazine.com/lacreativemap.htm

using:

  var overlay;

USGSOverlay.prototype = new google.maps.OverlayView();

then making it work with the: geoXml = new geoXML3.parser.

thx




--
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 google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


geoco...@gmail.com

unread,
Feb 26, 2011, 11:46:31 PM2/26/11
to Google Maps JavaScript API v3
On Feb 26, 8:05 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> chnaged the xml source to test on my server. your link worked straight away
> in firefox. refreshed it and it didnt show them again, is the cache.
>
> any how mine didnt work any time i tested. so eventually thought maybe its
> the browser.
>
> IE showed mine working straight away, but it doesnt like a refresh. doesnt
> show them in the 4 columns after a refresh. not had it work straight away in
> firefox.
>
> but it your link worked straight away in firefox.
>
> thought i'd feedback that it sort of worked the 'quick and dirty'.
>
> i did keep clearing my firefox browser cache to test it btw.
>
> anyhow, its sort of working for now, better than what i have, thx.

Sorry, said it wasn't extensively tested, didn't try it at all in
firefox.

>
> now I will crack on with trying to find a way that displays the descriptions
> to get the address

If you have address data for all the placemarks and can add it in an
<address> element to each of the placemarks, I can put together an
example that uses that (as time permits). I'm just not going to
reverse geocode all those placemarks or look up all those addresses.

Another example of using the pmParseFn option of geoxml3 would
probably be worthwhile.

-- Larry

>
> and lastly tyring to make my overlay in the previous approach with kmllayer,http://visualisationmagazine.com/lacreativemap.htm
>
> using:
>
>   var overlay;
>
>   USGSOverlay.prototype = new google.maps.OverlayView();
>
> then making it work with the: geoXml = new geoXML3.parser.
>
> thx
>
> On Sat, Feb 26, 2011 at 11:32 PM, geocode...@gmail.com <geocode...@gmail.com
> >http://www.geocodezip.com/geoxml3_test/visualisationmagazine_com_geox...

geoco...@gmail.com

unread,
Feb 27, 2011, 12:10:25 AM2/27/11
to Google Maps JavaScript API v3
On Feb 26, 11:46 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Feb 26, 8:05 pm, Christopher Watson <chris.watso...@googlemail.com>
> wrote:
>
> > chnaged the xml source to test on my server. your link worked straight away
> > in firefox. refreshed it and it didnt show them again, is the cache.
>
> > any how mine didnt work any time i tested. so eventually thought maybe its
> > the browser.
>
> > IE showed mine working straight away, but it doesnt like a refresh. doesnt
> > show them in the 4 columns after a refresh. not had it work straight away in
> > firefox.
>
> > but it your link worked straight away in firefox.
>
> > thought i'd feedback that it sort of worked the 'quick and dirty'.
>
> > i did keep clearing my firefox browser cache to test it btw.
>
> > anyhow, its sort of working for now, better than what i have, thx.
>
> Sorry, said it wasn't extensively tested, didn't try it at all in
> firefox.
>
>
>
> > now I will crack on with trying to find a way that displays the descriptions
> > to get the address
>
> If you have address data for all the placemarks and can add it in an
> <address> element to each of the placemarks, I can put together an
> example that uses that (as time permits).  I'm just not going to
> reverse geocode all those placemarks or look up all those addresses.

Like this:
http://www.geocodezip.com/geoxml3_test/visualisationmagazine_com_geoxml3_mapB.html

Fill in the "Address goes here" for each Placemark and it will appear
in the sidebar(s) ["bottombars?]

-- Larry

Christopher Watson

unread,
Feb 28, 2011, 7:53:07 PM2/28/11
to google-map...@googlegroups.com
hey larry, thanks so much for your help. i knew i'd probably have to copy paste the address details, even if i didnt make this interactive 'bottombar?'

got your example working beautifully here: http://visualisationmagazine.com/lacreativemaptest.htm

for a while i didnt realise to view source when i kept copy pasting xml from directly as displayed in the browser (reminder for anyone who is as silly as me to do so).

again larry, it might be quicky and dirty, but seems to be sustaining refresh's now. thanks. so interactive, just how i'd imagined.


so a few little snags/tweaks if anyone can help.
first 2 below would be luxuries if easy, other two are integral to the design and look (tedious designer here)


  1. can i display the marker from 'style id = ' alongside the placemark name in bottombar columns using associated 'styleUrl'?

  1. also can i show only particular 'style id' set. so e.g. i have red markers, yellow markers and blue markers. can i click blue so to hide red and yellow?

would really enhance the usability of the map when there are so many markers.

i have managed to use projected overlay eg here; http://www.geocodezip.com/geoxml3_test/ProjectedOverlayTest.html

and make it work here: http://visualisationmagazine.com/lacreativemaptest.htm yay!

  1. but, does it automatically load semi transparent? 50% opacity 'ish? can it load fully as 100%, just a picture laid over the top like i did here: http://visualisationmagazine.com/lacreativemap.htm

lastly,

  1. why oh why, can i not stop it zooming out to like 4, when i've set to 12, and even put listeners into set 12?

      var zoomLevel;
  google.maps.event.addListener(map, 'zoom_changed', function() {
    zoomLevel = map.getZoom();
    if (zoomLevel == 0) {
      map.setZoom(12);
    }     
  });

i know i posted a lot, and trust me i trowl through examples at geocodezip.com. i did one code line paste at a time doing the projected overlay example through trial error and make it work.

hope people can help.

many thanks again larry, and everyone.

please help, its so close.

ps apologies for any typos or if it isnt clear, i do check it, its late. need a few zzzzz's



geoco...@gmail.com

unread,
Feb 28, 2011, 8:32:43 PM2/28/11
to Google Maps JavaScript API v3
On Feb 28, 4:53 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> hey larry, thanks so much for your help. i knew i'd probably have to copy
> paste the address details, even if i didnt make this interactive
> 'bottombar?'
>
> got your example working beautifully here:http://visualisationmagazine.com/lacreativemaptest.htm
>
> for a while i didnt realise to view source when i kept copy pasting xml from
> directly as displayed in the browser (reminder for anyone who is as silly as
> me to do so).
>
> again larry, it might be quicky and dirty, but seems to be sustaining
> refresh's now. thanks. so interactive, just how i'd imagined.
>
> *
> so a few little snags/tweaks if anyone can help.* first 2 below would be
> luxuries if easy, other two are integral to the design and look (tedious
> designer here)
>
>    1. can i display the marker from 'style id = ' alongside the placemark
>    name in bottombar columns using associated 'styleUrl'?

Sure.

>
>    1. also can i show only particular 'style id' set. so e.g. i have red
>    markers, yellow markers and blue markers. can i click blue so to hide red
>    and yellow?

Sounds like you want a "category" map like the one Mike Williams
describes here in his (v2) tutorial:
http://econym.org.uk/gmap/categories.htm
Translated to v3:
http://www.geocodezip.com/v3_MW_example_categories.html

>
> would really enhance the usability of the map when there are so many
> markers.

I was thinking you were going to want that.

>
> i have managed to use projected overlay eg here;http://www.geocodezip.com/geoxml3_test/ProjectedOverlayTest.html
>
> and make it work here:http://visualisationmagazine.com/lacreativemaptest.htmyay!
>
>    1. but, does it automatically load semi transparent? 50% opacity 'ish?

You have code on your page to set it to 100%: overlay.setOpacity(100)
You are loading it like this:
overlay = new ProjectedOverlay(map,'lamapterrain.jpg', bounds, {}) ;

That {} at the end would be (I believe without looking at the
documentation) an empty options object. I would suspect that you
could set the initial opacity there...


>    can it load fully as 100%, just a picture laid over the top like i did here:
>    http://visualisationmagazine.com/lacreativemap.htm
>
> lastly,
>
>    1. why oh why, can i not stop it zooming out to like 4, when i've set to
>    12, and even put listeners into set 12?

geoxml3 will autozoom to fit its contents unless you set the zoom
option to false (currently it is set to myGeoXml3Zoom which is true.

-- Larry

geoco...@gmail.com

unread,
Feb 28, 2011, 8:37:00 PM2/28/11
to Google Maps JavaScript API v3
On Feb 28, 5:32 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
http://visualisationmagazine.com/lacreativemaptest.htm?zoom=4

-- Larry


>
>
>
> >       var zoomLevel;
> >   google.maps.event.addListener(map, 'zoom_changed', function() {
> >     zoomLevel = map.getZoom();
> >     if (zoomLevel == 0) {
> >       map.setZoom(12);
> >     }      
> >   });
>
> > i know i posted a lot, and trust me i trowl through examples at
> > geocodezip.com. i did one code line paste at a time doing the projected
> > overlay example through trial error and make it work.
>
> > hope people can help.
>
> > many thanks again larry, and everyone.
>
> > please help, its so close.
>
> > ps apologies for any typos or if it isnt clear, i do check it, its late.
> > need a few zzzzz's- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

geoco...@gmail.com

unread,
Mar 2, 2011, 11:20:45 PM3/2/11
to Google Maps JavaScript API v3
On Feb 28, 5:32 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Feb 28, 4:53 pm, Christopher Watson <chris.watso...@googlemail.com>
> wrote:
>
> > hey larry, thanks so much for your help. i knew i'd probably have
> > to copy paste the address details, even if i didnt make this
> > interactive 'bottombar?'
>
> > got your example working beautifully here:

http://visualisationmagazine.com/lacreativemaptest.htm

>
> > for a while i didnt realise to view source when i kept copy
> > pasting xml from directly as displayed in the browser (reminder
> > for anyone who is as silly as me to do so).
>
> > again larry, it might be quicky and dirty, but seems to be
> > sustaining refresh's now. thanks. so interactive, just how i'd
> > imagined.
>
> > *
> > so a few little snags/tweaks if anyone can help.* first 2 below
> > would be luxuries if easy, other two are integral to the design
> > and look (tedious designer here)
>
> >    1. can i display the marker from 'style id = ' alongside the
> > placemark  name in bottombar columns using associated 'styleUrl'?
>
> Sure.

It would be easier if you used the same style for the same color
markers, right now:
<Style id="style57">
<Style id="style34">
<Style id="style56">
etc...
are all "purple" markers, which I would assume would be in the same
category. While it is possible to parse down to the icon, it is
probably easier to do it using the style id (as you suggested above),
but right now, that won't work very well.

Let me know if you make these modifications to your kml (the style id,
and the address details), I might if time permits create an example.

-- Larry

Christopher Watson

unread,
Mar 3, 2011, 7:53:45 AM3/3/11
to google-map...@googlegroups.com
hey larry,

thanks for getting back with this.

Only just got round to looking at the example of categories and its code to see what its doing etc and how i can try to adapt it.

I only quickly glanced at my kml/xml file and saw the style id that the google map kml gives the markers. i assumed the colours only had one id number. dont get why google gives them different.

so yes i'll sort the xml file out definetly, if you could work on a version and use, i guess, the most common id numbers already there to categories the colours that would be brilliant.

when we click to hide we will se which arent and make it easy enough to change them in the xml code.

erm... the categories example is the perfect function, and i was going to have ago at pulling the appropriate style id for the 'bottom bar' to just associate the correct colour pin.

this was first because i thought in the categories example, it adjusts the sidebar links to that of what markers are on show/selected/active, brill! can it do the same to my bottom bar, because if they have the appropriate style id attached, the data is there to differentiate, my logic. (can appreciate my functionality design view isnt probably as easy to render out in code, dont have enough knowledge of the code to realise difficulty)

so thats why that was first.

i looked at the xml in the categories example to see if easily adaptable (was quick i must add, got pulled away, my initial thought was how can i adapt the lat= lng= to my <point> where that info is contained.

but looking from design, is it hard to switch type="checkbox"?

Theatres: <input type="checkbox" id="theatrebox" onclick="boxclick(this,'theatre')"

to just using (know this wouldn't work, this is my code thinking) <img src="javascript:'<Style id="style57">'> so the type/checkbox is a picture of the pin, not a ticked checkbox?

so when they click a pin in the sidebar it hides it so that coloured pin arent on display or in sidebar menu and they have to click the category name again to bring the pin image back up in the sidebar and on the map? (sound conclusion, you hide a pin image, it hides it from the menu - this is beautiful function to me)

again, i'm under the assumption (having not a great knowledge of code) these things might be relatively straight forward or they might be time consuming, for me scouring for hours of examples that do it and trying desperately to tweak.

well, my thoughts for the hugely brilliant sidebar (you can see why i wanted the links as a bottom bar).


i did have ago ones i thought were easy,  chnaged true to false for the zoom, just about worked that out.

chnaged the javascript set opacity(100) in every format way i could to default loading porjected overlay to 100 inside the {} options for overlay. but no cigar. had the idea (...to skin the cat, as it were...) to load the javascript function as seperate onload event in body or beginning of head, the action is there for a hyperlink, surely it can be accessed the same way with an onload.

hopefully get on to it tonight and check those kml style id's if you have time you can post the style id's you used or when i get to i will post them. either way i think i could look for all instance in an example you generate and chnage that number to make it work.

really would appreicate your help larry. i've been working hard trying to find funding to get them printed and folded, not just interactive online.

chris

btw, please share the working examples at  your geocodezip. we can shorten the xml data to show it and chnage the overlay image. i'll direct a link over there when it gets to functional level that i can adapt the template of LA for the other places i've rendered in the kml layer approach and contextualise it with headings etc.

many thanks



geoco...@gmail.com

unread,
Mar 4, 2011, 1:55:25 AM3/4/11
to Google Maps JavaScript API v3
On Feb 28, 4:53 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> hey larry, thanks so much for your help. i knew i'd probably have to copy
> paste the address details, even if i didnt make this interactive
> 'bottombar?'
>
> got your example working beautifully here:http://visualisationmagazine.com/lacreativemaptest.htm
>
> for a while i didnt realise to view source when i kept copy pasting xml from
> directly as displayed in the browser (reminder for anyone who is as silly as
> me to do so).
>
> again larry, it might be quicky and dirty, but seems to be
> sustaining refresh's now. thanks. so interactive, just how i'd
> imagined.
>
> *
> so a few little snags/tweaks if anyone can help.* first 2 below
> would be luxuries if easy, other two are integral to the design and
> look (tedious
> designer here)
>
>    1. can i display the marker from 'style id = ' alongside the
> placemark name in bottombar columns using associated 'styleUrl'?

Like this?
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_icon_linkto.html?filename=http://www.geocodezip.com/geoxml3_test/visualisationmagazine_com_lacreativemap_kml.xml

-- Larry
>
>    1. also can i show only particular 'style id' set. so e.g. i have red
>    markers, yellow markers and blue markers. can i click blue so to hide red
>    and yellow?
>
> would really enhance the usability of the map when there are so many
> markers.
>
> i have managed to use projected overlay eg here;http://www.geocodezip.com/geoxml3_test/ProjectedOverlayTest.html
>
> and make it work here:http://visualisationmagazine.com/lacreativemaptest.htmyay!
>
>    1. but, does it automatically load semi transparent? 50% opacity 'ish?
>    can it load fully as 100%, just a picture laid over the top like i did here:
>    http://visualisationmagazine.com/lacreativemap.htm
>
> lastly,
>
>    1. why oh why, can i not stop it zooming out to like 4, when i've set to

Christopher Watson

unread,
Mar 4, 2011, 4:30:11 AM3/4/11
to google-map...@googlegroups.com
yeah, perfect, can they be displayed in the bottom bar effect we achived too? the sidebar is for the categories displays that you showed me.

just having a look at the source code now to see where they're being called.



geoco...@gmail.com

unread,
Mar 4, 2011, 9:48:38 AM3/4/11
to Google Maps JavaScript API v3
On Mar 3, 4:53 am, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> hey larry,
>
> thanks for getting back with this.
>
> Only just got round to looking at the example of categories and its
> code to see what its doing etc and how i can try to adapt it.

Proof of concept categories from kml styleId:
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_categories_linktoA.html?filename=http://www.geocodezip.com/geoxml3_test/nzhistory_net_nzmap_locations_kml.xml

(not particularly well tested)

-- Larry

>
> I only quickly glanced at my kml/xml file and saw the style id that
> the google map kml gives the markers. i assumed the colours only
> had one id number. dont get why google gives them different.
>
> so yes i'll sort the xml file out definetly, if you could work on a
> version and use, i guess, the most common id numbers already there
> to categories the colours that would be brilliant.
>
> when we click to hide we will se which arent and make it easy
> enough to change them in the xml code.
>
> erm... the categories example is the perfect function, and i was going to
> have ago at pulling the appropriate style id for the 'bottom bar' to just
> associate the correct colour pin.
>
> this was first because i thought in the categories example, it adjusts the
> sidebar links to that of what markers are on show/selected/active, brill!
> can it do the same to my bottom bar, because if they have the appropriate
> style id attached, the data is there to differentiate, my logic. (can
> appreciate my functionality design view isnt probably as easy to render out
> in code, dont have enough knowledge of the code to realise difficulty)
>
> so thats why that was first.
>
> i looked at the xml in the categories example to see if easily adaptable
> (was quick i must add, got pulled away, my initial thought was how can i
> adapt the lat= lng= to my <point> where that info is contained.
>
> but looking from design, is it hard to switch* type**=**"checkbox"?*
>
> Theatres: <input *type**=**"checkbox"* id="theatrebox"
> On Thu, Mar 3, 2011 at 4:20 AM, geocode...@gmail.com

Christopher Watson

unread,
Mar 6, 2011, 6:25:37 PM3/6/11
to google-map...@googlegroups.com
howdi larry,

got round to having ago. oh... thank you. it looks so good. might be sad, but its great to realise your idea in code, easy in style, but function thrrough code and style... wow!

ok. its here: http://visualisationmagazine.com/testmap.htm

i change your code in the 'bottom bar' to bbarHtml (everywhere it said side = b), so to differentiate from the categories sidebarHtml.

it works. yay.

found the line of code that was calling the unique coloured pin in the sidebar and fed it into the right place for the bottom bar (bbar).

Ok, here's my 'snag' list, errors.

MAIN:

  • the overlay, i tired putting it where we thought they were options but i did every variation under the sun to make it default to 100%, can you or anyone help load a projected overlay jpg in geoxml3 as 100% default opacity?

i might be a tedious designer here, but that 100% overlay is crucial to the design and look! please help!

  • the categories in the sidebar dont display when you first come to the page, you have to click a marker or link at the bottom and they appear, (but they work ;o) ). how can i make them appear as the page is loaded? (need people to know they're their right away.)
  • i broke the javascript show all function. i cant reload all the markers as like a 'return to default' as it were, why doesnt my link work?
NOT SO IMPORTANT, BUT ANNOYING:

  • the bottom bar doesnt load all my makers from the xml data. for instance their is 'Make/shift magazine', 'Peppers point' makers dont load in the bottom bar, whats stopping them, are they timing out?

  • when you click, for instance, 'out of nothing (light blue)' marker, many other links in bottom bar disappear? why do they disappear, cant we (not very tech savy...) put a call back to reload the bottom bar when clicked?

but, other than this, fantastic. cant believe it looks like this, so damn good. come on overlay, you must default load at 100%. hopefully people you can help me solve the rest.

please, its so close. help finish it!

ps, took an hour or so doing the style ids. addresses will be done soon.

thanks again larry. looks awesome.

geoco...@gmail.com

unread,
Mar 7, 2011, 1:50:48 AM3/7/11
to Google Maps JavaScript API v3
On Mar 6, 3:25 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> howdi larry,
>
> got round to having ago. oh... thank you. it looks so good. might be
> sad, but its great to realise your idea in code, easy in style, but
> function thrrough code and style... wow!
>
> ok. its here:http://visualisationmagazine.com/testmap.htm
>
> i change your code in the 'bottom bar' to bbarHtml (everywhere it said
> side = b), so to differentiate from the categories sidebarHtml.
>
> it works. yay.
>
> found the line of code that was calling the unique coloured pin in the
> sidebar and fed it into the right place for the bottom bar (bbar).
>
> Ok, here's my 'snag' list, errors.
>
> MAIN:
>
>    - the overlay, i tired putting it where we thought they were options
> but i did every variation under the sun to make it default to 100%, can
> you or anyone help load a projected overlay jpg in geoxml3 as 100%
> default opacity?
>
> i might be a tedious designer here, but that 100% overlay is crucial to
> the design and look! please help!


This works for me:
overlay = new ProjectedOverlay(map,'lamapterrain.jpg', bounds,
{percentOpacity:100}) ;

-- Larry



>
>    - the categories in the sidebar dont display when you first come to the
>    page, you have to click a marker or link at the bottom and they appear, (but
>    they work ;o) ). how can i make them appear as the page is loaded? (need
>    people to know they're their right away.)
>
>    - i broke the javascript show all function. i cant reload all the markers
>    as like a 'return to default' as it were, why doesnt my link work?
>
> NOT SO IMPORTANT, BUT ANNOYING:
>
>    - the bottom bar doesnt load all my makers from the xml data. for
>    instance their is 'Make/shift magazine', 'Peppers point' makers dont load in
>    the bottom bar, whats stopping them, are they timing out?
>
>    - when you click, for instance, 'out of nothing (light blue)' marker,

Christopher Watson

unread,
Mar 7, 2011, 2:50:51 AM3/7/11
to google-map...@googlegroups.com
cheers larry. working for me too.

i kept trying to use the same command from the javascript buttons on the page, {setOpacity:100} or {javascript:setOpacity=100}. had no idea of percent.

looks good. hopefully will iron out the snags in the bottom bar now. least we got the  main thing working.



geoco...@gmail.com

unread,
Mar 7, 2011, 9:25:54 AM3/7/11
to Google Maps JavaScript API v3
On Mar 6, 11:50 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> cheers larry. working for me too.
>
> i kept trying to use the same command from the javascript buttons
> on the page, {setOpacity:100} or {javascript:setOpacity=100}. had
> no idea of percent.

When in doubt, read the documentation. When you can't find the
documentation, read the code. The options for ProjectedOverlay are
described at the beginning of the file.

-- Larry

>
> looks good. hopefully will iron out the snags in the bottom bar
> now. least we got the  main thing working.
>
> On Mon, Mar 7, 2011 at 6:50 AM, geocode...@gmail.com
> <geocode...@gmail.com>wrote:

geoco...@gmail.com

unread,
Mar 8, 2011, 10:33:00 AM3/8/11
to Google Maps JavaScript API v3
On Mar 6, 3:25 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> howdi larry,
>
> got round to having ago. oh... thank you. it looks so good. might be
> sad, but its great to realise your idea in code, easy in style, but
> function thrrough code and style... wow!
>
> ok. its here:http://visualisationmagazine.com/testmap.htm
>
> i change your code in the 'bottom bar' to bbarHtml (everywhere it
> said side = b), so to differentiate from the categories sidebarHtml.
>
> it works. yay.

That may be true, but it is doing extra processing.

I changed the categories example to put the categories information in
a separate div, which can be put where ever you want it on the page.

It should also solve your problem.
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_categories_linktoA.html?filename=http://www.geocodezip.com/geoxml3_test/nzhistory_net_nzmap_locations_kml.xml

-- Larry

>
> found the line of code that was calling the unique coloured pin in
> the sidebar and fed it into the right place for the bottom bar
> (bbar).
>
> Ok, here's my 'snag' list, errors.
>
> MAIN:
>
>    - the overlay, i tired putting it where we thought they were options but
>    i did every variation under the sun to make it default to 100%, can you or
>    anyone help load a projected overlay jpg in geoxml3 as 100% default opacity?
>
> i might be a tedious designer here, but that 100% overlay is crucial to the
> design and look! please help!
>
>    - the categories in the sidebar dont display when you first come to the
>    page, you have to click a marker or link at the bottom and they appear, (but
>    they work ;o) ). how can i make them appear as the page is loaded? (need
>    people to know they're their right away.)
>
>    - i broke the javascript show all function. i cant reload all the markers
>    as like a 'return to default' as it were, why doesnt my link work?
>
> NOT SO IMPORTANT, BUT ANNOYING:
>
>    - the bottom bar doesnt load all my makers from the xml data. for
>    instance their is 'Make/shift magazine', 'Peppers point' makers dont load in
>    the bottom bar, whats stopping them, are they timing out?
>
>    - when you click, for instance, 'out of nothing (light blue)' marker,

geoco...@gmail.com

unread,
Mar 8, 2011, 11:03:59 AM3/8/11
to Google Maps JavaScript API v3
On Mar 8, 7:33 am, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Mar 6, 3:25 pm, Christopher Watson <chris.watso...@googlemail.com>
> wrote:
>
> > howdi larry,
>
> > got round to having ago. oh... thank you. it looks so good. might be
> > sad, but its great to realise your idea in code, easy in style, but
> > function thrrough code and style... wow!
>
> > ok. its here:http://visualisationmagazine.com/testmap.htm
>
> > i change your code in the 'bottom bar' to bbarHtml (everywhere it
> > said side = b), so to differentiate from the categories
> > sidebarHtml.
>
> > it works. yay.
>
> That may be true, but it is doing extra processing.
>
> I changed the categories example to put the categories information > in a separate div, which can be put where ever you want it on the
> page.
>
> It should also solve your problem.
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_categories_...
>
>  -- Larry
>
>
>
>
>
>
>
>
>
> > found the line of code that was calling the unique coloured pin in
> > the sidebar and fed it into the right place for the bottom bar
> > (bbar).
>
> > Ok, here's my 'snag' list, errors.
>
> > MAIN:
>
> >    - the overlay, i tired putting it where we thought they were options but
> >    i did every variation under the sun to make it default to 100%, can you or
> >    anyone help load a projected overlay jpg in geoxml3 as 100% default opacity?
>
> > i might be a tedious designer here, but that 100% overlay is crucial to the
> > design and look! please help!
>
> >    - the categories in the sidebar dont display when you first come to the
> >    page, you have to click a marker or link at the bottom and they appear, (but
> >    they work ;o) ). how can i make them appear as the page is loaded? (need
> >    people to know they're their right away.)
>
> >    - i broke the javascript show all function. i cant reload all the markers
> >    as like a 'return to default' as it were, why doesnt my link work?
>
> > NOT SO IMPORTANT, BUT ANNOYING:
>
> >    - the bottom bar doesnt load all my makers from the xml data.
> > for instance their is 'Make/shift magazine', 'Peppers point'
> > makers dont load in the bottom bar, whats stopping them, are they
> > timing out?

I doubt it. Looks like you have character encoding issues with the
apostrophes in the text. Try either html entity encoding them, using
UTF-8 for real or changing them to a normal apostrophe.

Also, looking at your xml, it looks like you have several definitions
of each style, that probably isn't a good idea.

-- Larry

Christopher Watson

unread,
Mar 8, 2011, 5:53:26 PM3/8/11
to google-map...@googlegroups.com
noticed whats happening with the bottom bar menu. the links show in the colomns are what pins are visible in the map. if i zoom out to see all pins it shows me 'make shift magazine' and the  others i couldnt see.

should remember to check the documentation. is there one for geoxml3 somewhere here, http://code.google.com/p/geoxml3/

will try and use that div elements example.

noticed the overlay remove was appearing again when i zoomed in atfer i'd removed it, so i took the toggle button off and just put setopacity to (0) as a link.

never click about the xml with 7 categories to the same link. was just swapping style12 etc to the correlating id. never dawned on me i can remove the other six as there is only one being referenced for that colour. oops! can sort out soon.

thanks larry


geoco...@gmail.com

unread,
Mar 8, 2011, 6:24:46 PM3/8/11
to Google Maps JavaScript API v3
On Mar 8, 2:53 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> noticed whats happening with the bottom bar menu. the links show in the
> colomns are what pins are visible in the map. if i zoom out to see all pins
> it shows me 'make shift magazine' and the  others i couldnt see.
>
> should remember to check the documentation. is there one for geoxml3
> somewhere here,http://code.google.com/p/geoxml3/
>
> will try and use that div elements example.
>
> noticed the overlay remove was appearing again when i zoomed in atfer i'd
> removed it, so i took the toggle button off and just put setopacity to (0)
> as a link.

You could use geoxml3 to load your GroundOverlay:
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_icon_linkto.html?lat=34.068512&lng=-118.395393&zoom=12&type=m&filename=http://www.geocodezip.com/geoxml3_test/visualisationmagazine_com_lac1.xml

-- Larry

Christopher Watson

unread,
Mar 13, 2011, 3:38:43 PM3/13/11
to google-map...@googlegroups.com
cheers larry. just got a few projected overlays to work and align. when i get time again i will have ago at the changing the bbar and sidebar that its at now.

http://vism.ag/lacm

this is a good example working.

maybe in future i'd like to link the hiding of red pins, to the bottom bar, so links with red icon attached dont display. but realised it as close to what i imagined.

thanks again for your help larry.



geoco...@gmail.com

unread,
Mar 13, 2011, 7:16:19 PM3/13/11
to Google Maps JavaScript API v3
On Mar 13, 12:38 pm, Christopher Watson
<chris.watso...@googlemail.com> wrote:
> cheers larry. just got a few projected overlays to work and align.
> when i get time again i will have ago at the changing the bbar and
> sidebar that its at now.
>
> http://vism.ag/lacm
>
> this is a good example working.
>
> maybe in future i'd like to link the hiding of red pins, to the
> bottom bar, so links with red icon attached dont display. but
> realised it as close to what i imagined.

To do that you need to recreate the sidebar on changes of the check
boxes, and inside the createSidebar routine check to see if the icon
is visible and don't add it to the sidebar if it is not visible (or
you could do it based on the state of the checkbox).

>
> thanks again for your help larry.

http://www.geocodezip.com/geoxml3_test/visualisationmagazine_com_lacreativemap_20110313a.html

A few of things:
1. your xml has some problems there are two placemarks that have the
description and address intermingled and which is technically invalid
xml (it also makes at least one of them display incorrectly in the
side bar)
2. you are getting javascript errors because you removed the element
with id="overlayToggle"
3. the Show All link no longer works because geoxml3 is not saving the
global bounds (geoXmlDoc.bounds), there is a work around for that in
the page above.

-- Larry

>
> On Tue, Mar 8, 2011 at 11:24 PM, geocode...@gmail.com
> <geocode...@gmail.com>wrote:
>
>
>
>
>
>
>
> > On Mar 8, 2:53 pm, Christopher Watson <chris.watso...@googlemail.com>
> > wrote:
> > > noticed whats happening with the bottom bar menu. the links show in the
> > > colomns are what pins are visible in the map. if i zoom out to see all
> > pins
> > > it shows me 'make shift magazine' and the  others i couldnt see.
>
> > > should remember to check the documentation. is there one for geoxml3
> > > somewhere here,http://code.google.com/p/geoxml3/
>
> > > will try and use that div elements example.
>
> > > noticed the overlay remove was appearing again when i zoomed in atfer i'd
> > > removed it, so i took the toggle button off and just put setopacity to
> > (0)
> > > as a link.
>
> > You could use geoxml3 to load your GroundOverlay:
>
> >http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_icon_linkto...

Christopher Watson

unread,
Mar 14, 2011, 4:47:37 PM3/14/11
to google-map...@googlegroups.com
hey larry,

yeah i need to examine the xml. i get lost looking into, not necessarily whats doing what, just it all looks the sanem and they blur into each other. will have a good rumage through it to see whats not displaying.

i changed the show all link to listen for the global bound change. thanks for fixing this. will try to have a spy at the javascript probs. that overlay toggle didnt realise i'd zoomed in and display my overlay again. so did the setOpacity & {projectedOpacity:100}. thanks for the show all fix larry.

a friend said also, when he clicked a link in the bottom bar, he didnt realise it changed something in the map, until a few times clicking and explroing he realised it changed the map.

so i thought some names and anchors could probably work to reorientate the page to see the map after a click in the bottom bar.

thought it has to use javascript i guess, only done it in html, because the links in bottom bar use javascript.

did it. yay.

found function GoToAnchor and moved the javascript:kmlClick() into an onclick="kmlClick()" and it still read the pin hyperlink and did the name and anchor.

thought i'd share for others if following. working here:

http://visualisationmagazine.com/sheffieldcreativemap.htm

geoco...@gmail.com

unread,
Mar 19, 2011, 9:11:24 PM3/19/11
to Google Maps JavaScript API v3
On Mar 13, 4:16 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Mar 13, 12:38 pm, Christopher Watson
>
> <chris.watso...@googlemail.com> wrote:
> > cheers larry. just got a few projected overlays to work and align.
> > when i get time again i will have ago at the changing the bbar and
> > sidebar that its at now.
>
> >http://vism.ag/lacm
>
> > this is a good example working.
>
> > maybe in future i'd like to link the hiding of red pins, to the
> > bottom bar, so links with red icon attached dont display. but
> > realised it as close to what i imagined.
>
> To do that you need to recreate the sidebar on changes of the check
> boxes, and inside the createSidebar routine check to see if the icon
> is visible and don't add it to the sidebar if it is not visible (or
> you could do it based on the state of the checkbox).
>
>
>
> > thanks again for your help larry.
>
> http://www.geocodezip.com/geoxml3_test/visualisationmagazine_com_lacr...
>
> A few of things:
> 1. your xml has some problems there are two placemarks that have
> the description and address intermingled and which is technically
> invalid xml (it also makes at least one of them display incorrectly
> in the side bar)
> 2. you are getting javascript errors because you removed the
> element with id="overlayToggle"

This issue:
> 3. the Show All link no longer works because geoxml3 is not saving
> the global bounds (geoXmlDoc.bounds), there is a work around for
> that in the page above.
should be fixed in the archive.

-- Larry

Christopher Watson

unread,
Mar 20, 2011, 1:08:14 PM3/20/11
to google-map...@googlegroups.com
hey larry,

yeah fixed the show all link with what you posted. you can see them all at http://creativemaps.vism.ag/

some point i might investigate how to tie the sidebar checkbox for categories to the bottom bar, so when they only show red pins, it only shows red pins in the bottom bar. might be a useful function.

also, still a vague idea, but having some local area extra links. so seeing sheffield, links to surrounding area maps appear, and clicking on one of the local area (barnsley) just refreshes the current map with the new data rather than load a new web page.

but its all good! might just link web pages for now.

cheers
Message has been deleted

geoco...@gmail.com

unread,
Mar 21, 2011, 6:04:12 PM3/21/11
to Google Maps JavaScript API v3
On Mar 21, 2:56 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> i saw this, that has a few markers, but i'd only need the circle outline to
> surround 1 marker that is active?
>
> http://www.geocodezip.com/v3_polyline_example_arc.html
>
> also could it be filled and semi transparent overlay when active?

Sure. The documentation explains all the parameters of polygons.

>
> how do i work out the radius?

Convert it to meters? Or change the function to use whatever your
units of choice are.

>
> I want it to work as one coloured radius to depict 5mins walking distance
> from a location, and then a second toggle button to hide/view a second to
> depict 10 mins walking distance.
>
> can i adjust the colours too and opacity level etc of the polyline arc?

Yes. The documentation explains all the parameters of polylines.

>
> The second projected overlay is a bus routes map/image that i'd like to be
> able hide/view?

That isn't a question, even though it ends with a question mark. What
trouble are you having doing that?

-- Larry

>
> i'd do actual directions for the routes but not sure how exact to the routes
> they take would work. so a second projected overlay straight from the bus
> route map will work.
>
> hope you can help.
>
> chris
Message has been deleted

Christopher Watson

unread,
Mar 21, 2011, 6:25:36 PM3/21/11
to google-map...@googlegroups.com, geoco...@gmail.com
http://gmaps-samples-v3.googlecode.com/svn/trunk/circle-overlay/circle-overlay.html

ok, went lookingf further saw this that looks really simple. will have ago at attaching to a onclick function. prob b back when stuck.

the projected overlay, i want to have a second layer to load on top of the projected overlay already there and have its own toggle button, is this possible?

so layers in projected overlay, and one to load on top of the other, both controlled by buttons to hide/view.

hopefully bit clearer. i should review my writing more. sorry for confusion.


Christopher Watson

unread,
Mar 21, 2011, 6:47:31 PM3/21/11
to google-map...@googlegroups.com, geoco...@gmail.com
ok had a go at circle.


http://creativemaps.vism.ag/circle.htm

how can i use a different measurement? doesnt say below?

http://code.google.com/apis/maps/documentation/javascript/reference.html#CircleOptions

trying to make the diameter of the circle to 1320 feet... answers.com for a 5minute walk.

i tried converting to km working out at 0.402336 km.

thanks

chris

Christopher Watson

unread,
Mar 21, 2011, 7:25:40 PM3/21/11
to google-map...@googlegroups.com, geoco...@gmail.com
prob solved.

i went searchign and found another http://creativemaps.vism.ag/circle2.htm

documentation here: http://code.google.com/apis/maps/articles/mvcfun.html

just updating as i go... going to try add the colour customing from the documentation and make a second one for longer distance. then see how to make them attach to pins when clicked.

hmm... keep fiddling and hopefully getting them to work.

still curious about the second projected overlay mind you.

Christopher Watson

unread,
Mar 21, 2011, 8:16:01 PM3/21/11
to google-map...@googlegroups.com, geoco...@gmail.com
tried to attach to pins when clicked

http://creativemaps.vism.ag/circle3.htm

its probably way off but cant quite make the radius overlay display from an onclick. is it way off?

well, my thinking was when i can get it to be used as an onlick i can try to attach the onlick to pins in here for example http://creativemaps.vism.ag/la.htm

ona further note, tried to add

       function RadiusWidget() {
         var circle = new google.maps.Circle({
           strokeWeight: 0  
           fillcolor: #ff66ff
         });

but didnt work.

can anyone help with the seperate javascript link to a function to display the circle overlay? or the colour styling of the circle overlay?


geoco...@gmail.com

unread,
Mar 21, 2011, 8:40:38 PM3/21/11
to Google Maps JavaScript API v3
On Mar 21, 5:16 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> tried to attach to pins when clicked
>
> http://creativemaps.vism.ag/circle3.htm
>
> its probably way off but cant quite make the radius overlay display from an
> onclick. is it way off?

Don't you get a javascript error on that page?

Error: map is not defined
Source File: http://creativemaps.vism.ag/circle3.htm
Line: 99

-- Larry

>
> well, my thinking was when i can get it to be used as an onlick i can try to
> attach the onlick to pins in here for examplehttp://creativemaps.vism.ag/la.htm

Christopher Watson

unread,
Mar 21, 2011, 9:15:48 PM3/21/11
to google-map...@googlegroups.com

Yeah, not sure how to get round it. Just trying to make the circle overlay work from onclick rather than load.

If can do that then sure can try attach to current active pin.

On 22 Mar 2011 00:40, "geoco...@gmail.com" <geoco...@gmail.com> wrote:

On Mar 21, 5:16 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:

> tried to attach to pins when clicked
>
> http://creativemaps.vism.ag/circle3.htm
>

> its probably ...

Don't you get a javascript error on that page?

Error: map is not defined
Source File: http://creativemaps.vism.ag/circle3.htm
Line: 99

 -- Larry


>
> well, my thinking was when i can get it to be used as an onlick i can try to

> attach the onlick to pins in here for examplehttp://creativemaps.vism.ag/la.htm

>
> ona further note, tried to add
>
>        function RadiusWidget() {

>          var circle = new ...

geoco...@gmail.com

unread,
Mar 21, 2011, 9:22:07 PM3/21/11
to Google Maps JavaScript API v3
On Mar 21, 6:15 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> Yeah, not sure how to get round it.

You are trying to access the "map" variable which is local to the
init() function in the global scope.

(this is a FAQ) for details on scope see this page of Mike
Williams' (v2) tutorial:
Javascript Concepts -Part 1 Scope
http://econym.org.uk/gmap/scope.htm

1. outside all functions declare a global "map" variable.
var map = null;
2. initialize it in the init function:
function init() {
...
map = new google.maps.Map(mapDiv, {
...
}

> Just trying to make the circle overlay
> work from onclick rather than load.

html onclick functions run in the global scope.

-- Larry

>
> If can do that then sure can try attach to current active pin.
>

Christopher Watson

unread,
Mar 22, 2011, 9:53:59 AM3/22/11
to google-map...@googlegroups.com
hey,
 
yeah, i moved it out of there to try and isolate it for a seperate onclick function. it works here where i didnt remove it.
 
 
was fiddling to try and make it load from a javascript onclick, rather than on page load.
 
not sure how to write it into an onclick rather than on load.
 
if i can isolate it to an on click, then i might be able to adapt it to identify what pin is active to put the circle overlay around when link to display is clicked. (on this http://creativemaps.vism.ag/manchester.htm)
 
can it be isolated to an onclick function to display circle overlay? and how?
 
sorry didnt mean to avoid the faq, will have a peruse of them see if an example is in there too.
#
thanks
 
chris

geoco...@gmail.com

unread,
Mar 22, 2011, 10:00:16 AM3/22/11
to Google Maps JavaScript API v3
On Mar 22, 6:53 am, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> hey,
>
> yeah, i moved it out of there to try and isolate it for a seperate > onclick function. it works here where i didnt remove it.
>
http://creativemaps.vism.ag/circle2.htm
>
> was fiddling to try and make it load from a javascript onclick,
> rather than on page load.
>
> not sure how to write it into an onclick rather than on load.

Read my previous post, it explains the problem and how to fix it.

>
> if i can isolate it to an on click, then i might be able to adapt
> it to identify what pin is active to put the circle overlay around
> when link to display is clicked. (on this

http://creativemaps.vism.ag/manchester.htm

> )
>
> can it be isolated to an onclick function to display circle
> overlay? and how?
>
> sorry didnt mean to avoid the faq, will have a peruse of them see
> if an example is in there too.

It isn't in the FAQ. I probably should have said "almost a FAQ" but
it is very frequently asked (and answered). If you don't understand
my previous answer, searching the group should find lots of examples.

-- Larry

> #
> thanks
>
> chris
>
> On Tue, Mar 22, 2011 at 1:22 AM, geocode...@gmail.com

Christopher Watson

unread,
Mar 22, 2011, 8:15:18 PM3/22/11
to google-map...@googlegroups.com
hey,

yeah sorry, didnt realise you were providing the answer. i had ago at the var map = null; and trying to call it in
        var map = new google.maps.Map(mapDiv, {
map: null,

i moved out the distancewidget but it comes up saying 'object doesnt support this property or method'.

i search the forum and group, i come accross things but they dont use the mvc distance widget or radius widget.

i'm sorry if im repeating a regular query, please post an example or similiar prob and i can try see the error.


also, i only want to hide the circle distance radius overlay, not the pin. can isolate just the distance radius overlay?

i think i did the var map = null; etc as you said.

thanks

chris



Christopher Watson

unread,
Mar 22, 2011, 8:17:04 PM3/22/11
to google-map...@googlegroups.com
knew i was forgetting something

http://creativemaps.vism.ag/circle.htm

geoco...@gmail.com

unread,
Mar 22, 2011, 8:45:21 PM3/22/11
to Google Maps JavaScript API v3
On Mar 22, 5:15 pm, Christopher Watson <chris.watso...@googlemail.com>
wrote:
> hey,
>
> yeah sorry, didnt realise you were providing the answer. i had ago at the
> var map = null; and trying to call it in
>
>         var map = new google.maps.Map(mapDiv, {
>           map: null,
>
> i moved out the distancewidget but it comes up saying 'object doesnt support
> this property or method'.
>
> i search the forum and group, i come accross things but they dont use the
> mvc distance widget or radius widget.
>
> i'm sorry if im repeating a regular query, please post an example or
> similiar prob and i can try see the error.

Pretty much all my examples do that (have a global map variable)...
Including all the ones I have already posted to this thread.

>
> also, i only want to hide the circle distance radius overlay, not the pin.
> can isolate just the distance radius overlay?
>
> i think i did the var map = null; etc as you said.

Really?

function init() {
var mapDiv = document.getElementById('map-canvas');
var map = new google.maps.Map(mapDiv, {

The "var map" above makes that "map" variable local to the init
function.

It isn't there in this post from earlier in this thread:
http://groups.google.com/group/google-maps-js-api-v3/msg/12f6fb314f9b82f9

-- Larry

>
> thanks
>
> chris
>
> On Tue, Mar 22, 2011 at 2:00 PM, geocode...@gmail.com

Rossko

unread,
Mar 22, 2011, 9:36:45 PM3/22/11
to Google Maps JavaScript API v3
>         var map = new google.maps.Map(mapDiv, {
>           map: null,

errm, what is the map:null bit for? An API map object doesn't have a
'map' option
http://code.google.com/apis/maps/documentation/javascript/reference.html#MapOptions

> i'm sorry if im repeating a regular query, please post an example or
> similiar prob and i can try see the error.

Let's do it the other way round, you post a link to your example and
someone can tell you what's wrong with it. I know you've posted
several, but which one are we on now?

Christopher Watson

unread,
Mar 23, 2011, 7:40:54 AM3/23/11
to google-map...@googlegroups.com
hi,
 
sorry if i keep changing examples. it's cos i keep testing.
 
my working example of making the circle overlay is here: http://creativemaps.vism.ag/circle2.htm
 
my broken example of trying to make it work as an onclick is here: http://creativemaps.vism.ag/circle.htm
 
 
i would like to make an onclick that hides just the circle overlay around the marker, not the overlay and the marker. is this http://creativemaps.vism.ag/circle.htm way off achieving this?
 
i used the map:null to try and make the init global and not localized. didnt realise that 'var map' made map variable local.
 
thanks chris
 
 
 
 
 


 

--

Rossko

unread,
Mar 23, 2011, 2:03:19 PM3/23/11
to Google Maps JavaScript API v3
> my broken example of trying to make it work as an onclick is here:http://creativemaps.vism.ag/circle.htm

This one _still_ has the 'map' scope issue.

var map ;
function xx() {
var map = ......

Here, variable called 'map' is defined in global scope.
When xx() is run, a new variable 'map' is created - but it is local in
scope to xx() and disappears when xx() has finished.
If something like a click event now tries to use ,map', it will get
the global 'map' which is still null.
Your browser is telling where the problem lies with its error message,
are you not looking at these?

var map ;
function xx() {
map = ......

There's only one 'map'

Christopher Watson

unread,
Mar 24, 2011, 7:52:21 AM3/24/11
to google-map...@googlegroups.com
hey thanks for the help.

this is probably really simple and i can understand the whole no second map. so maybe i'm going at it the wrong way to achieve my function.

can this way work, is it a minor fix that someone can show me.

i went looking through the documentation and noticed 'fillOpacity' & 'strokeOpacity' options.

now, bear with me, to hide the projected overlay here: http://creativemaps.vism.ag/sheffield.htm

i use: <a href="javascript:overlay.setOpacity(25)" style="text-decoration: none;">25%</a>

BROKE page. i have tried to adapt the overlay.setOpacity into the same idea here: http://creativemaps.vism.ag/circle.htm


using:

<a href="javascript:Circle.fillOpacity(0.0)" style="text-decoration: none;">25%</a>

again, i adapt, not particular sure of the parameters that i might be neglecting. the error message i was getting i think was 'the object is undefined' if this helps. how can i fix it?

is this approach easier (even possible...) to fix than before?

see circle is loaded within radius widget, can it just be accessed with javascript:Circle.fillOpacity(0.0)?


if this isn't possible to do it this way, can someone suggest/point me in the direction to an approach that i can hide the circle overlay and then see it again with a link?

I just know trying to work out the previous approach was going to be difficult for me.

thanks

chris




--

Rossko

unread,
Mar 24, 2011, 8:14:53 AM3/24/11
to Google Maps JavaScript API v3
> i have tried to adapt the overlay.setOpacity into the same idea
> here:http://creativemaps.vism.ag/circle.htm
...
> <a href="javascript:Circle.fillOpacity(0.0)" style="text-decoration:
> none;">25%</a>

What javascript error does your browser report when you click? You
must find out how to see this if you are going to develop code.
Hint; it is complaining that 'Circle' is undefined or similar.
Where in your code is 'Circle' defined, what scope is that in?
In fact I can't see you creating 'Circle' anywhere, though you do
create a 'circle'. javascript is case sensitive.
Will it still be available after that function has finished?
Reply all
Reply to author
Forward
0 new messages