I spoke too soon, I now have a new problem to work on! I appear to
have broken the info window in the process of getting the custom icons
to work?!
I'm guessing the lines below are responsible:
// A function to create the marker and set up the event window
function createMarker(point,name,value) {
// === create a marker with the requested icon ===
var marker = new GMarker(point, gicons[value]);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(value);
});
return marker;
}
The "marker.openInfoWindowHtml(value); " line will show just the
value, but I'd like it to show both value and score in the same format
as newly created markers (IE "Value: <value> Score: <score>"
Any help on this is appreciated, I've tried adding the score to the
window but it seems I can only get either some plain text to display,
the value, or nothing at all!
Regards,
Chris Moody
On Feb 25, 9:17 am, Chris Moody <[email protected]> wrote:
> Wow, thank you so much! I can't believe how simple the solution was
> after all the lengthy and convoluted attempts I made! You wouldn't
> believe some of the things I tried, and I was just missing that off
> the end!
>
> Thanks again!
>
> On Feb 24, 3:34 pm, "[email protected]" <[email protected]>
> wrote:
>
> > On Feb 24, 7:11 am, Chris Moody <[email protected]> wrote:
>
> > > Hello all.
>
> > > This is my first post/question here. I've been asked to look into
> > > making a gmap interface for a project at work where we can ask people
> > > to mark important locations, storing the information in a database. My
> > > programming and development knowledge is minimal at best, but somehow
> > > I have managed to create something that semi-works using Mikes
> > > tutorials on Econym as well as various other bits of info on the net.
>
> > > The current version of the map in question is
> > > here:http://www.zpyder.co.uk/tess/mapping/db4/test.html
>
> > > When the user clicks on a location on the map, it opens a window with
> > > 2 selection boxes, the user clicks the relevant boxes, choosing one of
> > > three values, and assigns a rank of importance, and then submits the
> > > marker. This then gets stored in a database.
>
> > > I've managed to use Mikes tutorials to get custom markers to show upon
> > > the page load. A different marker is used for each of the values.
>
> > > The problem is that new markers created in the current session default
> > > to the basic marker icon. I'd like to make it so that they also appear
> > > with the correct custom icon. I've tried a few different things and
> > > each thing has caused a different issue, from totally breaking the
> > > map, to not changing the icon from the green "temporary" one.
>
> > > The things I've tried have been messing around with:
>
> > > // == remove the input marker and replace it with a completed marker
> > > map.closeInfoWindow();
> > > var marker = createMarker(lastmarker.getPoint(),["Value: "+values+".
> > > Score: "+score+"."]);
> > > GEvent.trigger(marker,"click");
>
> > > }
>
> > > These have included changing "createMarker" to "new GMarker(point,
> > > gicons[value]); (this works for the existing points). I can tell that
> > > something may need to be different though as unlike the existing
> > > point, this doesn't use a function? Could it be something to do with
> > > the completed marker code not actually querying the database to get
> > > the latest value?
>
> > > I'm asking this as I've had a look through the help and it seems most
> > > custom icon questions refer to data being pulled from a database,
> > > rather than icons created in the session by the user?
>
> > > Any help is greatly appreciated, my hair loss has progressed to hair
> > > loss & greying hairs because of this project I'm sure!
>
> > > Thanks,
> > > Chris Moody
>
> > This line doesn't define the "value" argument to createMarker:
> > var marker = createMarker(lastmarker.getPoint(),["Value: "+values+".
> > Score: "+score+"."]);
> > it should be:
> > var marker = createMarker(lastmarker.getPoint(),["Value: "+values+".
> > Score: "+score+"."], values);
>
> > -- Larry
--
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.