Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

GoogleAPI 2.5-Eliminating NULL sidebar entries

 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
eatc7402
Smarty Rookie


Joined: 18 Feb 2008
Posts: 23

PostPosted: Sun Dec 07, 2008 11:34 pm    Post subject: GoogleAPI 2.5-Eliminating NULL sidebar entries Reply with quote

In an API 2.5 map I am laying diown an 'icon' as a map
marker, and then laying down a transparent 'number
text' on top of it, like this..

Code:
case "trk" :
             $map1->addMarkerIcon($truck_map_icon,$shadow_icon,25,20,0,0);
          $map1->addMarkerByCoords($Lon,$Lat,$Address_to_print, $Address_to_print_HTML);

             $map1->addMarkerIcon($trk_number_icon,$shadow_icon,19,13,0,0);
             $map1->addMarkerByCoords($Lon,$Lat,"",$Address_to_print_HTML);

          break ;


This gives an entry in the sidebar for the map_icon, but not for the second trk_number_icon.... at least in
Firefox, Netscape, and Opera the sidebar looks just fine.
But in IE6 the null list items that are output to sidebar
show up as a sidebar 'entry dot'. It there a way to either
get IE6 to disregard this 'false entry' or eliminate the unneeded list item if the sidebar string is going to
an IE browser.

Heres a url to one of the maps. Open it in IE, and then
in another browser like Firefox and the diffenences are
obvious.

http://www.extraalarm.org/stations/station_location_maps/mpls_fire_station_locations_prod.php

Any suggestions would be veru helpful, thanks.

Dave, eatc7402
Back to top
View user's profile Send private message Send e-mail
eatc7402
Smarty Rookie


Joined: 18 Feb 2008
Posts: 23

PostPosted: Wed Dec 10, 2008 3:36 am    Post subject: Reply with quote

My 'discovery' is that IE6 does NOT disregard 'empty' list entries. Firefox, Netscape, Opera DO disregard these
null list entries. Soooo... if you ever add a marker to a map,
and ARE generating a sidebar list you will be tempted
(like me) to simply generate a code like this...

Code:
$map1->addMarkerIcon($eng_number_icon,$shadow_icon,7,12,0,0);
$map1->addMarkerByCoords($Lon,$Lat, "", $Address_to_print_HTML);


Notice the empty ("") entry in the addMarkerByCoords
entry. In Firefox this works perfectly... that is it gets DISREGARDED, but not in IE.
You'll get an extra list item no matter what you do.

My Solution.... Well I disregarded the whole (well, most of) API 2.5 built-in sidebar building,
and built my own sidebar,
in which I only made my list out of those 'addMarker..'
item I definately wanted in the sidebar list.
But in order to make the LINKS back the item you want to for markers you placed
you need to keep track of the
the marker index numbers. The API uses an incrementing
index (zero-based) for EACH marker added to map,.
So you need to keep a set of markers yourself that MATCH, but only use the ones you desire for links'
by placing the code...
Code:
href="javascript:click_sidebar()"

class definition, by FILLING in the empty () with YOUR index number.

If your building you own sidebar you can treat the
sidebar area as any other html codeable area. Put lists, tables, images... anything you want. Just built a string containiing the html you need and use a php echo (yourstring) instead of the normal 'print sidebar' statement in the main map printing section.Just remember to keep track of sizes so it FITS in you sidebar space. The map links in my orginal message entry here now contains the custom sidebar.


eatc7402

eatc7402
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP