5 messages in com.googlegroups.google-mashup-editorRe: How to: colored markers?| Subject: | Re: How to: colored markers?![]() |
|---|---|
| From: | Jason (gmej...@google.com) |
| Date: | 04/01/2008 12:29:40 AM |
| List: | com.googlegroups.google-mashup-editor |
Hi Lela. The code provided above should prevent the green graphic from appearing when a marker is selected, but GME's custom code overrides this. So any marker added to a gm:map module will become green when selected, and I'm not aware of any technique to change this default behavior.
Of course, you can always add a Google Map to your mashup using the Google Maps API directly (see the link below for examples of how to do this), but doing so prevents you from taking advantage of everything GME has to offer, namely its feed integration which makes adding and removing markers as easy as editing rows in a list. It is an option, however.
http://code.google.com/apis/maps/documentation/introduction.html
- Jason
On Mar 28, 4:39 pm, lcp <lela...@gmail.com> wrote:
I'm sorry there must have been something wrong with my icon URL. Now my custom icons are showing and remain in place after the click. However the green placemark still shows up when a point is clicked on. Any way to change this? Also, I'd like to implement this for multiple Georss feeds - know of any good examples that have different icons for each feed?
Thanks,
Lela
<gm:page title="My App" authenticate="false" onload="init()">
<script> var selectedOverlay = null;
function init() { var map = google.mashups.getObjectById('myMap').getMap(); GEvent.addListener(map, "addoverlay", addOverlayHandler); GEvent.addListener(map, "click", clickHandler);}
function addOverlayHandler(overlay) { if (overlay.setImage) { overlay.setImage('http://gmaps-samples.googlecode.com/svn/trunk/ markers/circular/bluecirclemarker.png');} }
function clickHandler(overlay, point) { if (overlay) { if (selectedOverlay) { selectedOverlay.setImage('http://gmaps-samples.googlecode.com/svn/ trunk/markers/circular/bluecirclemarker.png');}
selectedOverlay = overlay;} }
</script>
<gm:map id="myMap" data="http://mapnut.com/calstatepark.xml" latref="geo:lat" lngref="geo:long"/>
</gm:page>
On Mar 28, 4:00 pm, lcp <lela...@gmail.com> wrote:
Hi Jason,
I've tried to follow all the threads and examples in this forum on adding custom markers but I'm having some trouble understanding how to do this within GME.
In the thread you reference below, your code example changes a marker from red to green when clicked on. But in the code I only see the blue blank png icon referenced. If I change that url to one of the other gmaps markers under ..svn/trunk/markers/ nothing changes - the markers are still red, then green when clicked.
It seems like the person in the thread you reference below was able to put in custom icons - but I'm not sure how to copy his code into GME to try it.
Thanks for the help,
Lela
On Feb 13, 11:15 am, Jason <gmej...@google.com> wrote:
Hi Valery. If you want to take advantage of the GMarker class'
setImage() method within your mashup, you will have to add yourmarkersto the map
using the Maps API rather than relying on GME to
place them for you.
The following thread contains an example of how to do this. You would have to modify it slightly to set a new image depending on the value of the corresponding entry's field, but it should help you get started.
Happy mashing! - Jason
On Feb 11, 3:27 pm, Valery35 <xbbs...@gmail.com> wrote:
How to make colored by field value (gm:select) GMapsmarkers?




