I don't know if I have to do anything else, but I set the shadows of the markers, but these are not shown on the map
this is my XHTML
<script src="http://maps.google.com/maps/api/js?sensor=true|false"
type="text/javascript"></script>
<script>
//<![CDATA[
function handleComplete(xhr, status, args){
var gmap = PF('gMapWV').getMap();
for(var i in gmap.markers)
{
var newMarker = eval("args.marker"+i);
var newPosition = eval("args.position"+i);
var oldMarker = gmap.markers[i];
oldMarker.setPosition(newPosition);
oldMarker.icon=newMarker.icon;
oldMarker.setShadow("https://maps.gstatic.com/mapfiles/ms2/micons/msmarker.shadow.png");
oldMarker.setMap(gmap);
}
}
// ]]>
</script>
</ui:define>
....
<p:poll interval="#{manageLoadExecution.refreshInterval}" listener="#{manageLoadExecution.ajaxPoll}" oncomplete="handleComplete(xhr, status, args)" />
<p:gmap widgetVar="gMapWV" id="gMapWV" center="#{manageLoadExecution.latitude} , #{manageLoadExecution.longitude}" zoom="#{manageLoadExecution.zoomLevel}" fitBounds="false" type="terrain" style="width:900px;height:400px" model="#{manageLoadExecution.mapLoadModel}" disableDefaultUI="false" >
<p:ajax event="overlaySelect" listener="#{manageLoadExecution.onMarkerSelect}" />
<p:gmapInfoWindow id="infoWindow" maxWidth="300">
<p:outputPanel style="text-align: left; display: block; margin: auto; height:270px; width:320px" rendered="#{! empty manageLoadExecution.selectedLoad}">
and this is my managed Bean
if(load.getColBuId() != null){
Marker colMarker = new Marker(new LatLng(load.getColBuId().getLatitude(),load.getColBuId().getLongitude()),load.getColBuId().getRef());
colMarker.setIcon(Constants.POI_COL_SITE);
colMarker.setShadow(Constants.POI_SHADOW);
markColList.add(colMarker);
}
if(load.getDelBuId() != null){
Marker delMarker = new Marker(new LatLng(load.getDelBuId().getLatitude(),load.getDelBuId().getLongitude()),load.getDelBuId().getRef());
delMarker.setIcon(Constants.POI_WELL_SITE);
delMarker.setShadow(Constants.POI_SHADOW);
markDelList.add(delMarker);
}
if(load.getLoadStatus().getLastLatitude() != null && load.getLoadStatus().getLastLongitude()!=null){
String alert = Constants.POI_LOAD_OK;
if(load.getMaxAlert()!= null && load.getMaxAlert()=='H'){
alert=Constants.POI_LOAD_ALERT;
}
//Marker loadMarker = new Marker(new LatLng(load.getLoadStatus().getLastLatitude(),load.getLoadStatus().getLastLongitude()),load.getRef(),alert,alert);
Marker loadMarker = new Marker(new LatLng(load.getLoadStatus().getLastLatitude(),load.getLoadStatus().getLastLongitude()),load.getRef());
loadMarker.setIcon(alert);
loadMarker.setShadow(Constants.POI_SHADOW);
markLoadList.add(loadMarker);
}
Icons are shown right, however shadows are not shown. Have I missing any step? Have I forgot to set any property? Path to images are ok, In fact I am using:
https://maps.gstatic.com/mapfiles/ms2/micons/msmarker.shadow.png
as shadow image
Thank you very much in advance
The Marker Shadows were removed in version 3.14 of the Google Maps Javascript API. Any shadows specified programmatically will be ignored.
It is from the official Google Documentation: https://developers.google.com/maps/documentation/javascript/markers#complex_icons
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments