My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
markerComponent  
Updated Apr 30, 2012 by Hazem.sa...@gmail.com

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 aerialb...@gmail.com, 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 project member Hazem.sa...@gmail.com, Oct 24, 2008
Comment by project member Hazem.sa...@gmail.com, 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 jpedd...@gmail.com, Nov 3, 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 project member Hazem.sa...@gmail.com, Nov 3, 2008

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

Thanks!

Comment by jpedd...@gmail.com, Nov 3, 2008

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

Comment by qumsi...@gmail.com, Nov 11, 2008

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

Comment by project member Hazem.sa...@gmail.com, 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 qumsi...@gmail.com, 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 project member Hazem.sa...@gmail.com, Nov 12, 2008

I will work on supporting this scenario.

Thank you!

Comment by ralph.we...@hitec.lu, Dec 5, 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 project member Hazem.sa...@gmail.com, Dec 5, 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 project member Hazem.sa...@gmail.com, Jan 31, 2009

@tmw:

Can you please send us a sample code?

Comment by tmw.doma...@comcast.net, Feb 2, 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 3, 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 project member Hazem.sa...@gmail.com, Feb 3, 2009

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

Thanks!

Comment by seba...@gmail.com, Sep 3, 2009

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

regards!!..

Comment by sira...@gmail.com, Dec 18, 2009

I am creating marker dynamically from backing bean. com.googlecode.gmaps4jsf.component.marker.Marker. How can i set color to the marker. I have not seen any color property

Thanks

Comment by glory...@gmail.com, Feb 22, 2010

hi,all. i've encountered a weird problem. any advice will be appreciated. when i create a m:marker in a map using el to determine its lat and lng, as below:

<m:marker
    latitude="#{location.latitude}" 
    longitude="#{location.longitude}" 
    draggable="true" 
    submitOnValueChange="true" 
    valueChangeListener="#{actionBean.doMarkerMoved}"/> 

and the actionBean.doMarkerMoved is as below:

public void doMarkerMoved(ValueChangeEvent? event){
    String newLatLngStr = event.getNewValue().toString(); 
    List<String> machedStrs = RegrexUtils?.getRegrexPatternStringFromSrc(Convention.DOUBLE_REGREX, newLatLngStr); 
    String newLat = machedStrs.get(1).trim(); 
    String newLng = machedStrs.get(0).trim(); 
    location.setLatitude(newLat); 
    location.setLongitude(newLng); 
    //... 
}

when i drag the marker, everything is fine, and the location.latitude & location.longitude is updated.

but afetr that when i change the value of location.latitude & location.longitude, the marker remain at the old place, which is weird, because its latitude & longitude has been changed again. can anyone find problems in my codes? sorry for my english and really thanks to any reply.

Comment by project member Hazem.sa...@gmail.com, Feb 22, 2010

Guys, please move all of these discussions to the project mailing list: http://groups.google.com/group/gmaps4jsf-dev

Comment by project member Hazem.sa...@gmail.com, Feb 22, 2010

@glorysdj,

How do you change its value?

P.S. Please move this discussion thread to the discussion group as I cannot look at all the comments in the wiki pages.

Thanks!

Comment by robertsi...@gmail.com, Mar 2, 2010

What Im doing wrong, please ! I built an icon and I'm trying to use like that:

<m:marker latitude="#{marc.latitude}" longitude="#{marc.longitude}">

<m:icon imageURL="/Icons/googleMaps/mark_s_yellow.png" /> <m:htmlInformationWindow htmlText="#{marc.text}"/>
</m:marker>

The problem is that the icon is not renderizing.. only the shadow appear !

Thks.

Comment by project member robert2...@gmail.com, Aug 14, 2010

NetBeans? code completions shows the following attributes for the marker component:

address, binding, converter, draggable, id, immediate, jsVariable, latitude, locationNotFoundErrorMessage, longitude, rendered, required, showInformationEvent, showLocationNotFoundMessage, submitOnValueChange, validator and value

Note that supported supported basic HTML tag attributes are listed

Note that HTML Pass-Through attributes are not referenced here or in the Apache Tomahawk related document for their components: http://myfaces.apache.org/tomahawk-project/tomahawk12/tagdoc.html

Please consider adjusting the tag library documentation accordingly.

Comment by jaloc8829, Aug 17, 2010

I've a list with objects, they've latitude and longitude as attributes. I want to show markers with this list dynamicly into the m:maps tag.

How can I access to that list dynamicly, inside the m:map tag, considering that the list is into the managedBean?

Thanks for helping!!

Comment by kasprzyk...@gmail.com, May 12, 2011

Is there a way to rerender only marker, not the whole map using Ajax? Any suggestions will be apprecieted.


Sign in to add a comment
Powered by Google Project Hosting