Problem with list

6 posts by 2 authors in: Forums > CMS Builder
Last Post: May 25, 2009   (RSS)

By willbegood - May 25, 2009

Hello, i'm trying to built a goggle map app with CMS Builder, i work find, i'm only trying to simplify the icon management stuff for each point i'm placing on the map.

Here is the stuff :
Actualy let's say i have only 1 section call "myGEOpoint" define as bellow:
- Lattitude
- Longitude
- Title
- Description
- Photo
- Icon

As you can guess, i will always use a set of about 10 icon to illustrate stuff like : restaurant, museum, metro station etc etc.
So like it is for the moment, i will always have to upload via "icon" field the same icons again and again.

So what i'm trying to do is to have another section call "Icon Management" defined as bellow :
- Icon Title
- Icon Image (upload field)

And now on the other side on "myGEOpoint" section, for the field icon, i will have a list (instead of upload) populated from db.
as "name" for the list i define "Icon Title"
as "value" i define "Icon Image" > because here what i whant to retrieve is the url of the icon stored in my CMS.

And i doesn't work.
I suppose this is because "icone Image" have many variable in it (url, width, height, info1, info2 etc.

How to deal with this, i suppose i have to make a custom MySQL query to populate the list.

Please help.

Re: [willbegood] Problem with list

By ross - May 25, 2009

Hi there.

Thanks for posting!

I don't quite understand what you are trying to do. It sounds like you have several kinds of listings in your database and would like to have them all show up on a google map with different icons for each type of listing.

Is that the case? Let me know if I am on the right track or not.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [willbegood] Problem with list

By ross - May 25, 2009

Hi there.

That makes much more sense :). The only thing is that I haven't seen that done before so we'll definitely need to take this one step at a time.

Now that you already have the sections setup, what you'll want to do is setup a sample map with completely hardcoded values so you can see what the code is supposed to look like when you are done.

This way you have a working example to base your PHP code on.

Get that setup and let me know :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Problem with list

By willbegood - May 25, 2009

Hello ROSS
Remember, everything works perfectly, i just want to manage icon differently, storing them in a separate editor
Here is the code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAARgR4xlMgV9e6kkiDQ8hK4hS8TNkyoli3TUxYsOTPxfjfFRWiPBSRUGjlfDZqQKhXhLt8iiJiF4nj-Q" type="text/javascript"></script>
<script type="text/javascript" src="mapstraction.js"></script>
<style type="text/css">
#mapstraction {
height: 600px;
width: 800px;
}
</style>


</head>
<body>
<div id="wrap">

<div class="middle">

<div id="mapstraction"></div>
<script type="text/javascript">
var mapstraction = new Mapstraction('mapstraction','google');
var myPointx = new LatLonPoint(16,-61);
mapstraction.setCenterAndZoom(myPointx, 10);
mapstraction.addLargeControls();
// MYPOINT 6
var myPoint6 = new LatLonPoint(16.34542,-61.590567);
my_marker6 = new Marker(myPoint6);
my_marker6.setIconSize([50,50]);
// bellow i call my icon image
my_marker6.setIcon('user_check.png');
mapstraction.addMarker( new Marker( new LatLonPoint(16.34542,-61.590567)));
my_marker6.setLabel("Ilet Fajou");
var text6 = "<b>Ilet Fajou</b><br>ggfgdffdg<br><img src='8554484.jpg' width='200' height='150'/>";
my_marker6.setInfoBubble(text6);
mapstraction.addMarker(my_marker6);
// MYPOINT 4
var myPoint4 = new LatLonPoint(16.219949175712056,-61.48773193359375);
my_marker4 = new Marker(myPoint4);
my_marker4.setIconSize([50,50]);
// bellow i call my icon image
my_marker4.setIcon('star.png');
mapstraction.addMarker( new Marker( new LatLonPoint(16.219949175712056,-61.48773193359375)));
my_marker4.setLabel("Le Gosier");
var text4 = "<b>Le Gosier</b><br>aaaaaaaaaaaaaaa<br><img src='Image_2.png' width='74' height='73'/>";
my_marker4.setInfoBubble(text4);
mapstraction.addMarker(my_marker4);
// MYPOINT 3
var myPoint3 = new LatLonPoint(15.897942401022089,-61.3311767578125);
my_marker3 = new Marker(myPoint3);
my_marker3.setIconSize([50,50]);
// bellow i call my icon image
my_marker3.setIcon('dm_lite_preview-2_php_001.png');
mapstraction.addMarker( new Marker( new LatLonPoint(15.897942401022089,-61.3311767578125)));
my_marker3.setLabel("Grand-Bourg");
var text3 = "<b>Grand-Bourg</b><br>bbbbbbbbbbbbbbb<br><img src='Image_3.png' width='134' height='127'/>";
my_marker3.setInfoBubble(text3);
mapstraction.addMarker(my_marker3);
// MYPOINT 2
var myPoint2 = new LatLonPoint(15.284185114076433,-61.37786865234375);
my_marker2 = new Marker(myPoint2);
my_marker2.setIconSize([50,50]);
// bellow i call my icon image
my_marker2.setIcon('dm_lite_preview_php_001.png');
mapstraction.addMarker( new Marker( new LatLonPoint(15.284185114076433,-61.37786865234375)));
my_marker2.setLabel("Saint-Georges");
var text2 = "<b>Saint-Georges</b><br>ccccccccccccccccc<br><img src='Image_4.png' width='134' height='126'/>";
my_marker2.setInfoBubble(text2);
mapstraction.addMarker(my_marker2);
</script>

</div>


</body>
</html>

Re: [willbegood] Problem with list

By ross - May 25, 2009

Hi there.

Thanks for posting that code. Is CMS Builder creating that all for you? Or is that hardcoded onto the page.

If it's done by CMS Builder, could you post me a copy of your template file so I can see the code?

This could end up being a bit more than we can handle in the forums but I'll do everything I can for you here. Get me a copy of this page, and we'll go from there.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/