My favorites | Sign in
Logo
                
Search
for
Updated May 22, 2009 by Hazem.saleh
markerComponent  

It can be a child of the (map) component.

Attributes

Beside the JSF UIComponent standard attributes.

Component Attribute Required Description Default value
longitude false The longitude of the marker. If not set then the parent map longitude will be taken. NA
latitude false The latitude of the marker. If not set then the parent map latitude will be taken. NA
draggable false This flag determines whether the marker is draggable. false
jsVariable false This flag determines the Javascript variable you want to use for referring to the marker. Use this attribute if you want to use write additional Javascript code for the marker to customize it. NA
showInformationEvent (since 1.1.1) false This attribute determines the event on which the marker information will be shown. The marker information should be represented as a child htmlInformationWindow component of the marker component. click
showLocationNotFoundMessage (since 1.1.2) false This attribute determines whether to show an error message when the location is not found. false
submitOnValueChange (since 1.1.2) false This attribute determines whether to submit when the marker value changed. false


Comment by aerialbear, Oct 24, 2008

The marker tag does not seem to respect the rendered attribue: I tried marker rendered="false" and it still renders. Am I doing something wrong?

Comment by Hazem.saleh, Oct 24, 2008
Comment by Hazem.saleh, Oct 24, 2008

I filed the issue1?, and fixed it for you.

http://code.google.com/p/gmaps4jsf/issues/detail?id=8

I uploaded the last snapshot jar.

Comment by jpeddle1, Nov 03, 2008

For creating multiple markers on a map, is there a way to dynamically set the zoom and center of the map to fit all the markers? It's possible to do this using JS by using the GBounds class. I can provide the JS to do this if you'd like.

Comment by Hazem.saleh, Nov 03, 2008

Please do this, and open adding new feature issue here: http://code.google.com/p/gmaps4jsf/issues/list

Thanks!

Comment by jpeddle1, Nov 03, 2008

I've opened the following issue for this: http://code.google.com/p/gmaps4jsf/issues/detail?id=10

Comment by qumsiehk, Nov 11, 2008

The marker is always bouncy if draggable. Is there a way to set "bouncy=false"? Please advice.

Comment by Hazem.saleh, Nov 11, 2008

I think that this behavior cannot be changed from the Google Maps APIs. If you find a way, please tell us, and we will add this as a new feature.

Comment by qumsiehk, Nov 12, 2008

I can do this in JavaScript? as follows:

markerOptions = { draggable:true, bouncy:false }; marker = new GMarker(point, markerOptions);

The reason I am trying to set "bouncy=false" is that in my JSF page when the marker bounces it triggers the eventListner twice??!!!

<m:eventListener eventName="dragend" jsFunction="findStreetView"/>

In this case, if the street view for the marker location is not available I am doing a JS alert

alert("Sorry, there is no street view available for this location!");

When using GMaps4JSF it trigger this alert twice because the marker is bouncy. I think this is a bug since I have tried the same in JS and it didn't trigger the alert twice.

Please look into this and let me know if I need to do something, or if I am doing something wrong.

Comment by Hazem.saleh, Nov 12, 2008

I will work on supporting this scenario.

Thank you!

Comment by ralph.we...@hitec.lu, Dec 05, 2008

First of all - forgive me if this is a dumb question (I'm rather new to JSF), but I didn't find anything like this in the examples here...

Is there a simple way to add multiple markers to a map, based on a dynamic list of coordinates from a managed JSF bean? I tried something like the following within the <m:map> (using tomahawk), to no effort...

<t:dataList var="loc" layout="simple" value="#{locbean.locations}">
  <m:marker latitude="#{loc.latitude}" longitude="#{loc.longitude}">
  </m:marker>
</t:dataList>
Comment by Hazem.saleh, Dec 05, 2008

I'm working on this issue here: http://code.google.com/p/gmaps4jsf/issues/detail?id=9 to provide a simpler interface to do this.

Thank you!

Comment by tmw.doma...@comcast.net, Jan 29, 2009

I don't know if this is possible, but could markerComponent be extended to use "A", "B", "C" and similar letters for the markers? It seems possible based on an example of Google's static map API: http://code.google.com/apis/maps/documentation/staticmaps/

This would make my search results a little slicker. Very happy with gmaps4jsf so far! Thanks for the good work.

Comment by Hazem.saleh, Jan 31, 2009

@tmw:

Can you please send us a sample code?

Comment by tmw.doma...@comcast.net, Feb 02, 2009

I think I want something like this, but the last two attributes would be new attributes on marker. I'm basing this on info from this page: http://code.google.com/apis/maps/documentation/staticmaps/#MarkerDescriptors

I'm hoping this is a very small and easy thing to add, just exposing functionality in Google Maps that already exists.

<m:marker latitude="#{loc.geoLat}" longitude="#{loc.geoLng}" color="red" character="A"/>
<m:marker latitude="#{loc.geoLat}" longitude="#{loc.geoLng}" color="blue" character="B"/>
<m:marker latitude="#{loc.geoLat}" longitude="#{loc.geoLng}" color="green" character="C"/>

Based on the reference page, the supported colors are {black, brown, green, purple, yellow, blue, gray, orange, red, white}, but I would suggest having that just be a pass-through in case more colors are added in the future.

The "character" can only be a single lowercase alphanumeric character from the set {a-z, 0-9}.

Adding this would let me drop a bunch of icons I'm currently using to identify locations from A-Z.

Comment by tmw.doma...@comcast.net, Feb 03, 2009

While I'm at it, how about three new attributes instead of two? All based on that same markerdescriptors page above.

The new attributes are: color, character, and size. All three of these are already supported by Google maps, so the trick here is just exposing that same functionality in Gmaps4JSF, assuming things work the way I think they do. (I could be wrong...)

Does this seem doable? I haven't looked at the code yet to see if I could submit a patch, but I could try that once time permits.

<m:marker latitude="#{loc.geoLat}" longitude="#{loc.geoLng}" color="red" character="a" size="tiny"/>
<m:marker latitude="#{loc.geoLat}" longitude="#{loc.geoLng}" color="blue" character="b" size="mid"/>
<m:marker latitude="#{loc.geoLat}" longitude="#{loc.geoLng}" color="green" character="c" size="small"/>
<m:marker latitude="#{loc.geoLat}" longitude="#{loc.geoLng}" color="green" character="d" /> <!-- no size, so "normal" used -->

Note: I fixed the example so the characters are lowercase. My first example was invalid...

Comment by Hazem.saleh, Feb 03, 2009

Please open adding new feature issue here: http://code.google.com/p/gmaps4jsf/issues/list

Thanks!

Comment by sebaxtz, Sep 03, 2009

is there any way to track a click ?... I mean, grab the server side event of a click, like the dragging events?..

regards!!..


Sign in to add a comment
Hosted by Google Code