On Mar 23, 7:38 am, "J.S" <[email protected]> wrote:
> Hi,
>
> For my Dissertation I am creating a Google Map system so far it is
> made to upload custom markers image from a MYSQL database and then
> display them using XML, it displays the custom markers but displays
> them the same size of the default markers making them appear narrow
> and stretched. Online I found this script that enables me to change
> the custom markers size:
>
> var cafeIcon = new GIcon();
> cafeIcon.image = "http://chart.apis.google.com/chart?
> chst=d_map_pin_icon&chld=cafe|996600";
> cafeIcon.shadow = "http://chart.apis.google.com/chart?
> chst=d_map_pin_shadow";
> cafeIcon.iconSize = new GSize(12, 20);
> cafeIcon.shadowSize = new GSize(22, 20);
> cafeIcon.iconAnchor = new GPoint(6, 20);
> cafeIcon.infoWindowAnchor = new GPoint(5, 1);
> // Set up our GMarkerOptions object literal
> markerOptions = { icon:cafeIcon };
>
> I have quite a lot of custom markers and doing it this way will
> require me to create this script for every marker taking up alot of
> time and space, Is there any way I can use MYSQL, Javascript and XML
> and create script like the one above to be able to set the settings
> for all markers at once instead of creating a script for all of them
> individually???

Part 16 Associative arrays and custom icons
http://econym.org.uk/gmap/basic16.htm

  -- Larry


>
> this is the SQL for the database and some data I entered so you get an
> idea of what i'm doing:
>
> CREATE TABLE markers (
>   id int(11) NOT NULL auto_increment,
>   name varchar(25) NOT NULL default '',
>   address varchar(50) NOT NULL default '',
>   latitude decimal(10,6) NOT NULL default '0.000000',
>   longitude decimal(10,6) NOT NULL default '0.000000',
>   type varchar(25) NOT NULL default '',
>   icon  BLOB NOT NULL,
>   PRIMARY KEY  (id)
> ) TYPE=MyISAM;
>
> INSERT INTO `markers` (`name`, `address`, `latitude`, `longitude`,
> `type`, `icon`) VALUES ('KFC', '43 Kingsthorpe Road, Northampton, NN2
> 6EZ', '52.264486', '-0.900029', 'restaurant', 'kfc');
> INSERT INTO `markers` (`name`, `address`, `latitude`, `longitude`,
> `type`, `icon`) VALUES ('Mc Donalds', '9-13 The Drapery, Northampton,
> Northamptonshire, NN1 2ET', '52.237149', '-0.897647', 'restaurant',
> 'mcdonalds');
>
> The XML file used to GET the details and plot them on my map:
>
> <?php header("Content-type: text/xml");?>
> <markers>
> <?php
> //connect to db
>
> $link = mysql_connect("194.81.104.27", "www", "www") or die("Could not
> connect: " . mysql_error());
> mysql_selectdb("p1",$link) or die ("Can\'t use dbmapserver : " .
> mysql_error());
>
> //run query
> $result = mysql_query("select * from markers");
>
> //loop data
> while($data = mysql_fetch_array($result)){
>         echo ("\t <marker lat=\"$data[latitude]\" lng=\"$data[longitude]\"
> html=\"$data[address]\"  label=\"$data[name]\" icontype=\"$data[icon]
> \"/>");}
>
> ?>
>
> </markers>
>
> Apologies if my question seems blunt if you need me to elaborate more
> just ask, Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-api?hl=en.

Reply via email to