Wikicrimes - mapping crimes collaboratively

Risk area identified by the system

This is a risk area identified by the system:

You can:
It'll be visible on the map everytime you login.
Sending an image with information about this area.
You can alter the limits according to your interest.

You can:
Choose the most proper name to represent it.
Don't show this area anymore when I login.
Sending an image with information about this area.
You can alter the limits according to your interest.
Mapping Crimes: Theft, Robbery, Fights, Murder | WikiCrimes.org

Mapping crimes collaboratively

Login | Join | Help
Error - /mostrarCrimesMain.xhtml @40,106 value="#{mostrarDadosForm.crimeService.crimesMaisComentados}": Error reading 'crimesMaisComentados' on type com.sun.proxy.$Proxy11

An Error Occurred:

/mostrarCrimesMain.xhtml @40,106 value="#{mostrarDadosForm.crimeService.crimesMaisComentados}": Error reading 'crimesMaisComentados' on type com.sun.proxy.$Proxy11

+ Stack Trace

javax.el.ELException: /mostrarCrimesMain.xhtml @40,106 value="#{mostrarDadosForm.crimeService.crimesMaisComentados}": Error reading 'crimesMaisComentados' on type com.sun.proxy.$Proxy11
	at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
	at javax.faces.component.UIData.getValue(UIData.java:920)
	at org.apache.myfaces.component.html.ext.HtmlDataTableHack.createDataModel(HtmlDataTableHack.java:437)
	at org.apache.myfaces.component.html.ext.HtmlDataTable.createDataModel(HtmlDataTable.java:847)
	at org.apache.myfaces.component.html.ext.HtmlDataTableHack.getDataModel(HtmlDataTableHack.java:414)
	at org.apache.myfaces.component.html.ext.HtmlDataTable.getDataModel(HtmlDataTable.java:839)
	at org.apache.myfaces.component.html.ext.HtmlDataTableHack.getRowCount(HtmlDataTableHack.java:87)
	at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:221)
	at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:134)
	at org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.encodeChildren(HtmlTableRenderer.java:187)
	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:527)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:239)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:247)
	at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
	at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
	at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
	at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.wikicrimes.filter.IE9CompatablityFixServlet.doFilter(IE9CompatablityFixServlet.java:19)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.wikicrimes.web.MessageFilter.doFilter(MessageFilter.java:32)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
	at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
	at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
	at java.lang.Thread.run(Thread.java:744)
Caused by: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQL [select crime0_.CRI_IDCRIME as CRI1_4_, crime0_.CRI_QUANTIDADE as CRI2_4_, crime0_.CRI_FAIXA_ETARIA as CRI3_4_, crime0_.CRI_QTD_MASCULINO as CRI4_4_, crime0_.CRI_QTD_FEMININO as CRI5_4_, crime0_.CRI_LATITUDE as CRI6_4_, crime0_.CRI_LONGITUDE as CRI7_4_, crime0_.CRI_DESCRICAO as CRI8_4_, crime0_.CRI_REGISTRADO_PELA_API as CRI9_4_, crime0_.CRI_CHAVE as CRI10_4_, crime0_.CRI_ENDERECO as CRI11_4_, crime0_.CRI_CIDADE as CRI12_4_, crime0_.CRI_ESTADO as CRI13_4_, crime0_.CRI_EMBED_NOTICIA as CRI14_4_, crime0_.CRI_LINK_NOTICIA as CRI15_4_, crime0_.CRI_PAIS as CRI16_4_, crime0_.CRI_DATA as CRI17_4_, crime0_.CRI_HORARIO as CRI18_4_, crime0_.CRI_STATUS as CRI19_4_, crime0_.CRI_SEXO as CRI20_4_, crime0_.CRI_CONFIRMACOES_POSITIVAS as CRI21_4_, crime0_.CRI_CONFIRMACOES_NEGATIVAS as CRI22_4_, crime0_.CRI_VIEW as CRI23_4_, crime0_.CRI_QTD_COMENTARIOS as CRI24_4_, crime0_.CRI_IP as CRI25_4_, crime0_.CRI_CEP as CRI26_4_, crime0_.CRI_DATA_HORA_REGISTRO as CRI27_4_, crime0_.CRE_CREDIBILIDADE as CRE28_4_, crime0_.CRI_CACHE_ESTATISTICAS as CRI29_4_, crime0_.CRI_ID_ORIGINAL as CRI30_4_, crime0_.TVI_IDTIPO_VITIMA as TVI31_4_, crime0_.TLO_IDTIPO_LOCAL as TLO32_4_, crime0_.TAU_IDTIPO_ARMA_USADA as TAU33_4_, crime0_.TRE_IDTIPO_REGISTRO as TRE34_4_, crime0_.TPA_IDTIPO_PAPEL as TPA35_4_, crime0_.TCR_IDTIPO_CRIME as TCR36_4_, crime0_.TTR_IDTIPO_TRANSPORTE as TTR37_4_, crime0_.USU_IDUSUARIO as USU38_4_, crime0_.URS_IDUSUARIO_REDE_SOCIAL as URS39_4_, crime0_.CRI_ID_BASE_ORIGEM as CRI40_4_ from TB_CRI_CRIME crime0_, TB_CON_COMENTARIO comentario1_ where crime0_.CRI_IDCRIME=comentario1_.CRI_IDCRIME and crime0_.CRI_STATUS<>1 group by crime0_.CRI_IDCRIME order by count(comentario1_.CON_IDCOMENTARIO) desc]; SQL state [HY000]; error code [1030]; Got error 28 from storage engine; nested exception is java.sql.SQLException: Got error 28 from storage engine
	at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:120)
	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276)
	at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
	at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
	at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:377)
	at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:840)
	at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:832)
	at org.wikicrimes.dao.hibernate.CrimeDaoHibernate.getCrimesMaisComentados(CrimeDaoHibernate.java:496)
	at org.wikicrimes.service.impl.CrimeServiceImpl.getCrimesMaisComentados(CrimeServiceImpl.java:540)
	at sun.reflect.GeneratedMethodAccessor583.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
	at com.sun.proxy.$Proxy11.getCrimesMaisComentados(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor582.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
	at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
	at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.access$301(FacesCompositeELResolver.java:46)
	at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver$4.invoke(FacesCompositeELResolver.java:108)
	at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.invoke(FacesCompositeELResolver.java:148)
	at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:104)
	at org.apache.el.parser.AstValue.getValue(AstValue.java:118)
	at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
	at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
	... 55 more
Caused by: java.sql.SQLException: Got error 28 from storage engine
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2941)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1623)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1715)
	at com.mysql.jdbc.Connection.execSQL(Connection.java:3249)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1268)
	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1403)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
	at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
	at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
	at org.hibernate.loader.Loader.doQuery(Loader.java:674)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
	at org.hibernate.loader.Loader.doList(Loader.java:2220)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
	at org.hibernate.loader.Loader.list(Loader.java:2099)
	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
	at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
	at org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate(HibernateTemplate.java:849)
	at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
	... 83 more

+ Component Tree

<AjaxViewRoot id="_viewRoot" immediate="false" locale="en" renderKitId="HTML_BASIC" renderRegionOnly="false" rendered="true" selfRendered="false" submitted="false" transient="false" viewId="/main.xhtml">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:c="http://java.sun.com/jsp/jstl/core"> <head> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=#{messages['chave.googlemaps']}&sensor=false"/> <!-- <script type="text/javascript" src="scripts/elabel.js"/> --> <script type="text/javascript" src="scripts/comandosMapa.js"/> <script src="scripts/kernel_maptypecontrol.js" type="text/javascript"/> <!-- <script src="scripts/epoly.js" type="text/javascript"></script> -->
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"> <div style="visibility:hidden; position:absolute"> <h1>Wikicrimes - mapping crimes collaboratively</h1> </div>
<script> var chamouLoadMapa = false; var podeFecharModal = true; function loadMapa() { chamouLoadMapa=true;
load(#{filtroForm.latMapa},#{filtroForm.lngMapa},#{filtroForm.zoomMapa}); if("#{rpx_usuario_sem_email}" == "sim"){ mostrarModalSolicitandoEmail(); }
} </script> <script type="text/javascript"><!-- /* <![CDATA[ */ var googleMapsKey = "AIzaSyCq-ew-g-sm0xiB1nQODoI_p2tXksY70j0"; var msgNaoPodeCancelar = '#{messages["nao.pode.cancelar"]}'; //*********************** Area INICIO **************************** var labelArea = null; var vaiEditarArea = false; var estaRemovendoPoligono = false; var estaRegistrandoArea = false; var estaDesenhandoArea = false; var labelAreaAviso = null; var polygon = null; var eventoEndLine = null; var eventoFecharJanela = null; var eventoLineUpdate = null; var eventoClickArea = null; var eventoMoveMouse = null; var eventoClickMap = null; var excedeuLimite = false; var hintAjudaArea = null; //*********************** Area FIM **************************** var qtd_roubos = 0; var qtd_furtos = 0; var qtd_outros = 0; var qtd_denuncias = 0; var renovaSessao = false; var ignoraData; var clusterer; var map; var crime; var crime2; var id; var podeRegistrar = false; var podeCarregarCrimes = true; // boolean para checar se deve carregar crimes ou nao var lastBounds; // guarda os ultimos bounds var limpaTela = true; var idTipoCrime = 0; var idSubTipoCrime = 0; var geocoder; var crimesAtuais = {}; var ii = 0; var IE=false; var tempX = 0; var tempY = 0; var showWindow=false; var lastZoom; var atualiza=true; var atualizaGrupos=true; var filtrou=false; var mudouZoom; var infowindow = new google.maps.InfoWindow({}); browser=navigator.appName; check=browser.indexOf("Microsoft"); if (check!=-1) IE=true; function mostrarModalSolicitandoEmail(){ displayMessage('./falhaLoginRpx.html', 420, 200,'#{messages["message.wikicrimes"]}'); } function mostrarModalSolicitandoCidade(){ displayMessage('./informaCidade.html', 420, 280,'#{messages["message.wikicrimes"]}'); } function removerPoligono(){ estaRemovendoPoligono = true; if(!map.getInfoWindow().isHidden()) map.closeInfoWindow(); estaRegistrandoArea = false; if(polygon!=null){ if(polygon.getVertexCount()==0){ polygon.insertVertex(0, new google.maps.LatLng(88, 55)); polygon.insertVertex(1, new google.maps.LatLng(88, 54)); polygon.insertVertex(2, new google.maps.LatLng(88, 53)); polygon.insertVertex(3, new google.maps.LatLng(88, 52)); GEvent.trigger(polygon,'endline'); } map.removeOverlay(polygon); polygon = null; } if(eventoEndLine != null){ GEvent.removeListener(eventoEndLine); eventoEndLine = null; } if(eventoLineUpdate != null){ GEvent.removeListener(eventoLineUpdate); eventoLineUpdate = null; } if(eventoClickArea != null){ GEvent.removeListener(eventoClickArea); eventoClickArea = null; } if(eventoClickMap!=null){ GEvent.removeListener(eventoClickMap); eventoClickMap = null; } if(eventoFecharJanela!=null){ GEvent.removeListener(eventoFecharJanela); eventoFecharJanela = null; } if(labelArea != null){ map.removeOverlay(labelArea); } if(labelAreaAviso!=null){ map.removeOverlay(labelAreaAviso); } labelArea = null; labelAreaAviso = null; removeHintAjudaArea(); //pontosLatLngArea=new Array(); //pontosArea=new Array(); estaRemovendoPoligono = false; } function removeHintAjudaArea(){ if(eventoMoveMouse!=null){ GEvent.removeListener(eventoMoveMouse); eventoMoveMouse = null; } if(hintAjudaArea!=null){ map.removeOverlay(hintAjudaArea); hintAjudaArea = null; } } function mostrarPainelLogin(url, a){ openModal(url, 742, 320,'Login', a); return false; } function mostrarCarregandoPequeno(){ document.getElementById("loadingPequeno").style.visibility="visible"; } function escondeCarregandoPequeno(){ document.getElementById("loadingPequeno").style.visibility="hidden"; } function plotaEnderecoMap(response) { if (!response || response.Status.code != 200) { alert("#{messages['menu.mensagem.erro']}"); } else { //informando tutor que o usuario ja usou a busca por endereco jaMostrouAjudaPesquisa = true; place = response.Placemark[0]; point = new google.maps.LatLng(place.Point.coordinates[1],place.Point.coordinates[0]); var html=place.address + ' <br/> ' + '<b>Codigo Pais:</b> ' + place.AddressDetails.Country.CountryNameCode; switch(place.AddressDetails.Accuracy) { case 0: zoom=#{filtroForm.zoomMapa}; break; case 1: zoom=4; break; case 2: zoom=6; break; case 3: zoom=12; break; case 4: zoom=13; break; case 5: zoom=14; break; case 6: zoom=16; break; case 7: zoom=17; break; case 8: zoom=17; break; default: zoom=#{filtroForm.zoomMapa}; } isUpdatingMap = true; map.setZoom(zoom); isUpdatingMap = false; map.setCenter(point); map.openInfoWindowHtml(point,html); } } function preparaRequisicaoMudandoData(point, zoom){ var temp=podeCarregarCrimes; podeCarregarCrimes=false; if(point != null){ map.setCenter(point); map.setZoom(zoom); } ignoraData="false"; filtrou=false; tempDataMaisAntiga= new Date(); atualizaMapa(); podeCarregarCrimes=temp; } function createLabelTemp(point, tipoLabel) { var icone = new GIcon(); var marker; //icone.shadow = "./images/baloes/shadow50.png"; if (tipoLabel == 1) { icone.image = "./images/hints/area/"+"#{messages['webapp.area.hint.img1']}"; icone.iconSize = new GSize(276, 22); } if (tipoLabel == 2) { icone.image = "./images/hints/area/"+"#{messages['webapp.area.hint.img2']}"; icone.iconSize = new GSize(276, 22); } if (tipoLabel == 3) { icone.image = "./images/hints/area/"+"#{messages['webapp.area.hint.img3']}"; icone.iconSize = new GSize(398, 22); } icone.iconAnchor = new GPoint(2, 34); icone.infoWindowAnchor = new GPoint(9, 2); marker = new CrimeMarker(point, {draggable:true, icon:icone}); marker.idTipoCrime = tipoLabel; return marker; } function startShape() { estaRegistrandoArea = true; var contCliques = 0; eventoClickMap = GEvent.addListener(map, "click", function (overlay, latLng) { estaDesenhandoArea = true; if(contCliques==0){ removeHintAjudaArea(); hintAjudaArea = createLabelTemp(latLng, 2); map.addOverlay(hintAjudaArea); eventoMoveMouse=GEvent.addListener(map, "mousemove", function (latLng) { if (!hintAjudaArea) { hintAjudaArea = createLabelTemp(latLng, 2); map.addOverlay(hintAjudaArea); } else { hintAjudaArea.setLatLng(latLng); } }); } if(contCliques==2){ removeHintAjudaArea(); hintAjudaArea = createLabelTemp(latLng, 3); map.addOverlay(hintAjudaArea); eventoMoveMouse=GEvent.addListener(map, "mousemove", function (latLng) { if (!hintAjudaArea) { hintAjudaArea = createLabelTemp(latLng, 3); map.addOverlay(hintAjudaArea); } else { hintAjudaArea.setLatLng(latLng); } }); } contCliques++; }); hintAjudaArea = createLabelTemp(map.getCenter(), 1); map.addOverlay(hintAjudaArea); eventoMoveMouse=GEvent.addListener(map, "mousemove", function (latLng) { if (!hintAjudaArea) { hintAjudaArea = createLabelTemp(latLng, 1); map.addOverlay(hintAjudaArea); } else { hintAjudaArea.setLatLng(latLng); } }); //select("shape_b"); //var color = getColor(false); polygon = new GPolygon([], 'blue', 2, 0.7, '#000080', 0.2); /*GEvent.addListener(polygon, "cancelline", function() { alert("cancelline"); });*/ startDrawing("Shape 1", function() { //alert(polygon.getArea()); if(polygon != null){ var color; if(polygon.getArea()>2000000.0){ color = 'red'; excedeuLimite = true; } else{ color = 'blue'; excedeuLimite = false; } if(labelArea!=null){ map.removeOverlay(labelArea); } if(labelAreaAviso!=null){ map.removeOverlay(labelAreaAviso); } var maxLatIndice = 0; var maxLatitude = polygon.getVertex(0).lat(); for(var i = 1 ; i < polygon.getVertexCount() ; i++){ if(polygon.getVertex(i).lat()>maxLatitude){ maxLatIndice = i; maxLatitude = polygon.getVertex(i).lat(); } } if(polygon.getArea()>2000000.0){ labelAreaAviso = new ELabel(polygon.getVertex(maxLatIndice), '<div style="background-color:#ffffff;border:1px solid '+color+';color:'+color+';text-align:center;width:268px;height:14px"> #{messages["webapp.area.erro.limiteexcedido.tam.area2"]}</div>', null, new GSize(6,-30), 75); map.addOverlay(labelAreaAviso); } else{ labelAreaAviso = new ELabel(polygon.getVertex(maxLatIndice), '<div style="background-color:#ffffff;border:1px solid '+color+';color:'+color+';text-align:center;width:268px;height:14px"> #{messages["webapp.area.label.clique.na.area.registra.la"]}</div>', null, new GSize(6,-30), 75); map.addOverlay(labelAreaAviso); } labelArea = new ELabel(polygon.getVertex(maxLatIndice), '<div style="background-color:#ffffff;border:1px solid '+color+';color:'+color+';text-align:center;width:220px;height:14px"> #{messages["webapp.area.tamanho"]} '+ (Math.round(polygon.getArea() / 10000) / 100) + "km2" +'.</div>', null, new GSize(6,-10), 75); map.addOverlay(labelArea); } }, '#ff0000'); } function startDrawing(name, onUpdate, color) { map.addOverlay(polygon); polygon.enableDrawing({}); polygon.enableEditing({onEvent: "mouseover"}); polygon.disableEditing({onEvent: "mouseout"}); eventoEndLine = GEvent.addListener(polygon, "endline", function() { if(eventoClickMap!=null){ GEvent.removeListener(eventoClickMap); eventoClickMap = null; } estaDesenhandoArea = false; removeHintAjudaArea(); if(!estaRemovendoPoligono) registrarArea(); eventoLineUpdate = GEvent.bind(polygon, "lineupdated", null, onUpdate); eventoClickArea = GEvent.addListener(polygon, "click", function(latlng, index) { if(!estaRemovendoPoligono) registrarArea(); }); }); } function registrarArea(){ vaiEditarArea = false; if(polygon.getArea()>2000000.0){ excedeuLimite = true; } else{ excedeuLimite = false; } if(!excedeuLimite){ var latitudes=''; var longitudes=''; for(var i=0 ; i<polygon.getVertexCount();i++){ if(i!=polygon.getVertexCount()-1){ if(i==polygon.getVertexCount()-2){ latitudes+= polygon.getVertex(i).lat(); longitudes+= polygon.getVertex(i).lng(); } else{ latitudes+= polygon.getVertex(i).lat()+';'; longitudes+= polygon.getVertex(i).lng()+';'; } } } var myHtml = "<iframe src='./registrarArea.html?latitudes="+ latitudes +"&longitudes="+ longitudes +"&areaKm2="+polygon.getArea()+"' width='400' height='160' frameborder='0'></iframe>"; map.openInfoWindowHtml(polygon.getVertex(0),myHtml); eventoFecharJanela=GEvent.addListener(map,"infowindowbeforeclose", function(overlay,latlng) { if (overlay) { // ignore if we click on the info window return; }else{ if(vaiEditarArea){ polygon.enableEditing({onEvent: "mouseover"}); polygon.disableEditing({onEvent: "mouseout"}); } else{ selecionarComando(map, 'mao'); removerPoligono(); } } }); polygon.disableEditing({onEvent: "mouseover"}); } } //plotar no mapa minhas areas function plotaAreaMapaDaListagem(nome, pontosTexto){ //polyListArea.insertVertex(0, new GLatLng(88, 55)); var arrayPontos = pontosTexto.split('|'); var arrayLatLng = null; var cont = 0; var arrayPontosLatLng = new Array(); for(var i = 0; i < arrayPontos.length;i++){ if(arrayPontos[i]!=null && arrayPontos[i]!=''){ arrayLatLng = arrayPontos[i].split(';'); arrayPontosLatLng[cont] = new google.maps.LatLng(arrayLatLng[0], arrayLatLng[1]); //polyListArea.insertVertex(cont, new GLatLng(arrayLatLng[0], arrayLatLng[1])); cont++; arrayLatLng = null; } } arrayPontosLatLng[cont+1] = arrayPontosLatLng[0]; var polyListArea = new GPolygon(arrayPontosLatLng, 'blue', 2, 0.7, '#000080', 0.2); var label = new ELabel(polyListArea.getVertex(0), '<div style="background-color:#ffffff;border:1px solid blue;color:blue;width:120px;height:14px"> #{messages["webapp.area.clique.para.fechar"]} </div>', null, new GSize(6,-10), 75); GEvent.addListener(polyListArea, "click", function(latlng, index) { map.removeOverlay(label); polyListArea.hide(); }); GEvent.addListener(polyListArea, "mouseover", function(latlng, index) { map.addOverlay(label); }); GEvent.addListener(polyListArea, "mouseout", function(latlng, index) { map.removeOverlay(label); }); closeModal('modal'); map.addOverlay(polyListArea); map.setCenter(polyListArea.getVertex(0),zoomLimiteInfMarcadores); } // Call this function when the page has been loaded function load(_lat, _long, _zoom) { document.getElementById("loading").style.visibility = "visible"; map = new google.maps.Map(document.getElementById("map"),{ center: new google.maps.LatLng(_lat, _long), zoom: _zoom, mapTypeId: google.maps.MapTypeId.ROADMAP, panControl: true, streetViewControl: false, scaleControl: true, scrollwheel: false }); LegendaWikicrimes(map); ComandoEmbed(map); selecionarComando(map, 'mao'); //mostraComandosLogado(map); // Marcador Temporário var infoTT = document.createElement("div"); var posMarcador = null; //evento passado por parametro eventId = '#{param.eventId}'; eventType = '#{param.eventType}'; /*TEMP*/if(!eventId){ eventId = '#{param.idcrime}'; eventType = 'crime';} /*TEMP*/if(!eventId){ eventId = '#{param.idrelato}'; eventType = 'relato'; } idConfirmacao = '#{param.idconf}'; setPodeRegistrar(false, 0); google.maps.event.addListener(map, "mousemove", function(latLng) { if (podeRegistrar) { if (!crime) { crime = createMarkerTemp(latLng, idTipoCrime); map.addOverlay(crime); } else { crime.setLatLng(latLng); // Tooltip para o marcador temporário criado - INICIO // Calcula posição da tooltip var point = map.getProjection().fromLatLngToPoint(map.getProjection().fromPointToLatLng(new google.maps.Point(0,0),true),map.getZoom()); var offset = map.getProjection().fromLatLngToPoint(crime.getPoint(),map.getZoom()); var anchor = crime.getIcon().iconAnchor; var width = crime.getIcon().iconSize.width; var height = infoTT.clientHeight; map.controls[google.maps.ControlPosition.TOP_LEFT].push(new google.maps.LatLng(offset.x - point.x - anchor.x + width, offset.y - point.y -anchor.y -height)); infoTT.innerHTML = "<div class='infoMarcadorTemporario'>#{messages["marcador.temporario.toolTip.texto"]}</div>"; // Plota toolTip no mapa pos.apply(infoTT); map.getPane(G_MAP_FLOAT_PANE).appendChild(infoTT); infoTT.style.visibility="visible"; // Tooltip para o marcador temporário criado - FIM } } }); google.maps.event.addListener(map, "rightclick", function(event) { map.set('disableDoubleClickZoom', true); if (podeRegistrar) { setPodeRegistrar(false, 0); } // Esconde toolTip do marcador temporário. infoTT.style.visibility="hidden"; }); google.maps.event.addListener(map,"infowindowbeforeclose", function(event) { if(crime2){ map.removeOverlay(crime2); crime2=null; } }); google.maps.event.addListener(map, "click", function(event) { map.set('disableDoubleClickZoom', false); //*********************** ROTAS SEGURAS INICIO **************************** //contextmenu.style.visibility="hidden"; //*********************** ROTAS SEGURAS FIM **************************** if (podeRegistrar) { podeCarregarCrimes=false; crime2 = createMarker(latLng, idTipoCrime); //tive que comentar o markermanager pois dava erro quando utilizava o modo hibrido, adiciona com overlay e depois removo crime2.setMap(map); if (idTipoCrime == 6) crime2.registrarRelato(idTipoCrime, idSubTipoCrime); else crime2.registrarCrime(idTipoCrime, idSubTipoCrime); crime2.disableDragging(); map.enableDragging(); atualiza=true; atualizaGrupos=true; } setPodeRegistrar(false, 0); // Esconde toolTip do marcador temporário. infoTT.style.visibility="hidden"; }); google.maps.event.addListener(map, "moveend", function() { if (!isUpdatingMap) { limpaTela=false; atualizaMapa(); if(map.getZoom() >= 15) showDivComment(); else hideDivComment(); } }); google.maps.event.addListener(map, "zoomend", function (overlay, latLng) { mudouZoom = true; if(map.getZoom() >= 15) showDivComment(); else hideDivComment(); //GEvent.trigger(map,"moveend"); }); google.maps.event.addListener(map, 'idle', function(){ google.maps.event.trigger(map, "moveend"); }); //setTimeout(reqRenovaSessao,60000*9+30000); //*********************** Kernel Map INICIO **************************** ativaMapaKernel(true); exibirMinhasAreas(); //map.addControl(new KernelMapTypeControl()); //*********************** Kernel Map FIM **************************** //*********************** ROTAS SEGURAS INICIO **************************** //menu popup pra desenvolvimento, c testes pra rota segura, etc //controleMenu(map); //*********************** ROTAS SEGURAS FIM **************************** } function reqRenovaSessao(){ if(renovaSessao){ http_request = GXmlHttp.create(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } //Espera retorno do servidor http_request.open('GET', 'RenovaSessao', true); http_request.onreadystatechange = recuperaTxt; http_request.send(null); } } function recuperaTxt() { if (http_request.readyState == 4) { if (http_request.status == 200) { var documento = http_request.responseText; linhas = documento.split("\n"); //alert(linhas[0]); if (linhas.length > 1){ } } else { alert('Erro na requisição'); } } renovaSessao=false; setTimeout(reqRenovaSessao,60000*9+30000); } function zoomIn(i) { var marker = crimesAtuais[i]; map.setCenter(marker.getPosition()); map.setZoom(map.getZoom()+5); google.maps.event.trigger(marker, "click"); } function zoomOut(i) { var marker = crimesAtuais[i]; map.setCenter(marker.getPosition()); map.setZoom(map.getZoom()-5); google.maps.event.trigger(marker, "click"); } function zoomInGroup() { map.setCenter(map.getCenter(),6); map.setCenter(map.getCenter(),map.getZoom()-1); } function zoomOutGroup() { } function setPodeRegistrar(valor, idTipo, idSub) { if(!estaDesenhandoArea){ podeRegistrar = valor; idTipoCrime = idTipo; idSubTipoCrime = idSub; if (podeRegistrar) { //removerPoligono(); selecionarComando(map, 'nenhum'); // alert('Mova o mouse ao local do crime'); if (crime != null) { crime.hide(); } marcarMapaPrincipal(localizacao); } else { if (crime != null) { crime.hide(); } crime = null; tipoCrimeSel = 0; tipoVitimaSel = 0; } } } function showLocal() { var endereco = document.getElementById("pesquisa").value; geocoder = new google.maps.Geocoder(); geocoder.geocode({'address': endereco}, function(results, status){ if (status == google.maps.GeocoderStatus.OK) { if (results[0].types == 'country,political') { zoom = 4; } else if (results[0].types == 'administrative_area_level_1,political') { zoom = 6; } else if (results[0].types == 'locality,political') { zoom = 10; } else if (results[0].types == 'administrative_area_level_2,political') { zoom = 12; } else if (results[0].types == 'point_of_interest,establishment') { zoom = 18; } else { zoom = 17; } map.setZoom(zoom); map.setCenter(results[0].geometry.location); } else { alert("Geocode was not successful for the following reason: " + status); } }); } function mostraDialogMapa(idCrime) { displayMessage("./abuso.html?idCrime=" + idCrime,480,320,'Reporte de Abuso - WikiCrimes.org'); } function mostraDialogMapaRelato(idRelato) { displayMessage("./abuso.html?idRelato=" + idRelato,480,320,'Reporte de Abuso - WikiCrimes.org'); } /** * */ function CrimeMarker(latlng, opts) { var crimeMarker = new google.maps.Marker({ position: latlng, idCrime: 0, registrado: 0, evento: 0, texto: '' }); crimeMarker.setOptions(opts); return crimeMarker; } /** * */ /* CrimeMarker.prototype = new google.maps.Marker({ position: new google.maps.LatLng(0,0), map: map }); */ function showMarkerInfo(marker){ if(idConfirmacao){ if(eventType == 'crime') marker.confirmaCrime(idConfirmacao); else if(eventType == 'relato') marker.confirmaRelato(idConfirmacao); }else{ google.maps.event.trigger(marker, "click"); } } /** * */ function createMarker(point, tipoCrime) { var iconeBase = "./images/baloes/"; var icones = { 0: { icon: iconeBase + "marcadorNeutro.png", size: new google.maps.Size(24, 34) }, 1: { icon: iconeBase + "novoMarcadorVermelha.png", size : new google.maps.Size(14, 24) }, 2: { icon: iconeBase + "novoMarcadorAzul.png", size : new google.maps.Size(14, 24) }, 3: { icon: iconeBase + "novoMarcadorAzul.png", size : new google.maps.Size(14, 24) }, 4: { icon: iconeBase + "novoMarcadorVermelha.png", size : new google.maps.Size(14, 24) }, 5: { icon: iconeBase + "novoMarcadorLaranja.png", size : new google.maps.Size(14, 24) }, 6: { icon: iconeBase + "novoMarcadorVerde.png", size: new google.maps.Size(14, 24) }, 7: { icon: "./images/delegacia.png", size: new google.maps.Size(23, 34) } } var marker = new google.maps.Marker({ position: point, icon: icones[tipoCrime].icon, size: icones[tipoCrime].size, mostrarDados: function() { podeCarregarCrimes = false; var myHtml = "<iframe src='./mostrarDados.html?idCrime=" + marker.get("idCrime") + "' width='420' height='150' frameborder='0' style='z-index: 98;'></iframe>"; var myHtml2 = "<iframe src='./mostrarInformacoes.html?idCrime=" + marker.get("idCrime") + "' width='420' height='150' frameborder='0' style='z-index: 98;' ></iframe>"; infowindow.setContent(myHtml); infowindow.open(map, marker); //new GInfoWindowTab('#{messages["crimes.tabs.titulo.comentarios"]}', myHtml2)]); }, mostrarDadosRelato: function() { podeCarregarCrimes=false; var myHtml = "<iframe src='./mostrarDadosRelato.html?idRelato=" + this.get("idCrime") + "' width='400' height='150' frameborder='0' style='z-index: 98;'></iframe>"; infowindow.setContent(myHtml); infowindow.open(map, this); }, mostrarDadosDelegacias: function() { podeCarregarCrimes = false; var myHtml = "<iframe src='./mostrarDadosDelegacia.html?chave=" + this.get("idCrime") + "' width='400' height='150' frameborder='0' style='z-index: 98;'></iframe>"; infowindow.setContent(myHtml); infowindow.open(map, this); }, mostrarGraficos: function() { var myHtml = "<iframe src='./mostrarGraficos.html?agrupadorEstado=" + this.texto + "' width='400' height='150' frameborder='0' style='z-index: 98;'></iframe>"; infowindow.setContent(myHtml); infowindow.open(map, this); }, confirmaCrime: function(idConfirmacao) { var latitude = this.getPosition().lat(); var longitude = this.getPosition().lng(); var myHtml = "<iframe src='./confirmaCrime.html?idConfirmacao=" + idConfirmacao + "' width='400' height='180' frameborder='0'></iframe>"; infowindow.setContent(myHtml); infowindow.open(map, this); }, confirmaRelato: function(idConfirmacao) { var latitude = this.getPosition().lat(); var longitude = this.getPosition().lng(); var myHtml = "<iframe src='./confirmaRelato.html?idConfirmacaoRelato=" + idConfirmacao + "' width='400' height='180' frameborder='0'></iframe>"; infowindow.setContent(myHtml); infowindow.open(map, this); }, registrarCrime: function(idTipoCrime, idSubTipoCrime) { var latitude = this.getPosition().lat(); var longitude = this.getPosition().lng(); idTipoCrime = 5; idSubTipoCrime = 1; var myHtml = "<iframe src='./registrarCrime.html?latitude=" + latitude + "&longitude=" + longitude + "' width='515' height='205' frameborder='0'></iframe>"; infowindow.setContent(myHtml); google.maps.event.addListener(infowindow, 'closeclick', function(){ map.setOptions({ draggable: true, center: crime2.getPosition() }); crime2.setMap(null); }); infowindow.open(map, this); }, registrarRelato: function(idTipoRelato, idSubTipoRelato) { var latitude = this.getPosition().lat(); var longitude = this.getPosition().lng(); idSubTipoRelato = ''; var myHtml = "<iframe src='./registrarRelato.html?tipoRelato=" + idTipoRelato + "&subTipoRelato=" + idSubTipoRelato + "&latitude=" + latitude + "&longitude=" + longitude + "' width='600' height='180' frameborder='0'></iframe>"; infowindow.setContent(myHtml); infowindow.open(map, this); } }); marker.set("idTipoCrime", tipoCrime); return marker; } function createMarkerId(point, tipoCrime, idCrime, texto) { var marker = createMarker(point, tipoCrime); marker.setOptions({ draggable: false }); marker.set("idCrime", idCrime); marker.set("texto", texto); google.maps.event.addListener(marker, "click", function () { podeCarregarCrimes=false; if(marker.get("idTipoCrime") == 6){ marker.mostrarDadosRelato(); } else { if(marker.get("idTipoCrime") == 7){ marker.mostrarDadosDelegacias(); } else { if(marker.get("idTipoCrime") != 7){ marker.mostrarDados(); } } } }); //GEvent.addListener(marker, "mouseover", function () { // mostraTooltip(texto); //}); return marker; } function createMarkerGroup(point, texto) { var icone = new GIcon(); icone.image = "./images/baloes/vermelhoMais.png"; icone.iconSize = new GSize(27, 34); icone.iconAnchor = new GPoint(9, 34); icone.infoWindowAnchor = new GPoint(9, 2); var marker = new CrimeMarker(point, {draggable:false, icon:icone}); marker.texto=texto; GEvent.addListener(marker, "mouseover", function () { mostraTooltip(texto); }); GEvent.addListener(marker, "click", function () { marker.mostrarGraficos(); }); return marker; } function createMarkerTemp(point, tipoCrime) { var icone = new GIcon(); var marker; icone.iconSize = new GSize(23, 34); icone.iconAnchor = new GPoint(2, 34); icone.infoWindowAnchor = new GPoint(9, 2); if (tipoCrime) { if (tipoCrime == 1) { icone.image = "./images/baloes/marcadorTempVermelho.png"; } if (tipoCrime == 2) { icone.image = "./images/baloes/marcadorTempAzul.png"; } if (tipoCrime == 3) { icone.image = "./images/baloes/marcadorTempAzul.png"; } if (tipoCrime == 4) { icone.image = "./images/baloes/marcadorTempVermelho.png"; } if (tipoCrime == 5) { icone.image = "./images/baloes/marcadorTempLaranja.png"; } if (tipoCrime == 6) { icone.image = "./images/baloes/marcadorTempVerde.png"; } } if(tipoCrime == 0){ icone.image = "./images/baloes/marcadorNeutro.png" } marker = new CrimeMarker(point, {draggable:true, icon:icone}); marker = new CrimeMarker(point, {draggable:true, icon:icone}); marker.idTipoCrime = tipoCrime; return marker; } function mostraTooltip(text){ document.getElementById("cursor1").innerHTML=text; showWindow=true; } function limpaCrimesOutOfBounds(id, idRelato) { var mapBounds = map.getBounds(); //loop para checar crimes fora do viewport apaga todos os crimes fora do viewport com excecao do id for (k in crimesAtuais) { if (!mapBounds.contains(crimesAtuais[k].getPosition())){ if(crimesAtuais[id]!=crimesAtuais[k] && crimesAtuais[idRelato]!=crimesAtuais[k]){ removeComment(k); crimesAtuais[k].setMap(null); delete crimesAtuais[k]; } } } } function escondeTooltip(force) { if (force!=null && force==1) document.getElementById("cursor1").style.display="none"; showWindow=false; } function retornaIdUsuario(){ return '#{usuario.idUsuario}'; } function retornaEmailUsuario(){ return '#{usuario.email}'; } /*function mostraComandosLogado(mapa){ if(#{usuario.perfil.nome == 'CERTIFICADOR'}||#{usuario.perfil.nome == 'ADMINISTRADOR'}){ mapa.addControl(new ComandoGeradorEmbedded()); } }*/ function escondeTooltip(force) { if (force!=null && force==1) document.getElementById("cursor1").style.display="none"; showWindow=false; } function mostraHintComandosMapa(msg, top, left){ document.getElementById("divHintComandoMapa").style.top = top; document.getElementById("divHintComandoMapa").style.left= left; document.getElementById("divHintComandoMapa").style.visibility = "visible"; if(msg == "webapp.area.erro.info.hint.area") document.getElementById("msgHintComandoMapa").innerHTML = '#{messages["webapp.area.erro.info.hint.area"]}'; if(msg == "botoes.title.mover") document.getElementById("msgHintComandoMapa").innerHTML = '#{messages["botoes.title.mover"]}'; if(msg == "embedded.hint.comando.mapa") document.getElementById("msgHintComandoMapa").innerHTML = '#{messages["embedded.hint.comando.mapa"]}'; if(msg == "tutor.texto.filtro") document.getElementById("msgHintComandoMapa").innerHTML = '#{messages["tutor.texto.filtro"]}'; if(msg == "tutor.texto.kml") document.getElementById("msgHintComandoMapa").innerHTML = '#{messages["tutor.texto.kml"]}'; if( msg== "tutor.ajuda.hots.spots") document.getElementById("msgHintComandoMapa").innerHTML = '#{messages["tutor.ajuda.hots.spots"]}'; } function removeHintComandosMapa(){ document.getElementById("divHintComandoMapa").style.visibility = "hidden"; } function relatoRegistrado(chave, descricao) { crimesAtuais[chave] = crime2; addComment(chave, descricao); } function addComment(id, descricao){ var span = window.parent.document.getElementById('span_'+id); if (span == null) { if(map.getZoom()>=15){ var comment = window.parent.document.getElementById('comment'); var span = window.parent.document.createElement('span'); span.setAttribute('id','span_'+id); span.setAttribute('style', 'style="font-size:14px; color: yellow"'); span.innerHTML = ' - <a href="#"'+ ' onclick="showRelatedData(\''+id+'\')" style="background-color:#3A5FCD; color:yellow; text-decoration: none; font-style: normal;" onmouseover="highlightComment(\''+id+ '\', true)" onmouseout="highlightComment(\''+id+'\', false)">'+descricao+'</a><br/>'; comment.appendChild(span); } } } function removeComment(id){ var span = window.parent.document.getElementById('span_'+id); if (span != null) { var div = span.parentNode; span.parentNode.removeChild(span); if (div.childNodes.length == 1) div.style.display = 'none'; } } function showDivComment(){ /*var div = window.parent.document.getElementById('comment'); if (div != null && map.getZoom() >= 15 && div.childNodes.length > 1) { window.parent.document.getElementById('comment').style.display = 'block'; }*/ } function hideDivComment(){ var div = window.parent.document.getElementById('comment'); //if (div != null && map.getZoom() < 15) { window.parent.document.getElementById('comment').style.display = 'none'; //} } function showRelatedData(id) { for (k in crimesAtuais) { if(k == id) crimesAtuais[k].mostrarDadosRelato(); } } function highlightComment(id, highlight) { var mapBounds = map.getBounds(); for (k in crimesAtuais) { if(k == id){ if (highlight) { crimesAtuais[k].getIcon().image = "./images/baloes/relatoDestaque.png"; crimesAtuais[k].getIcon().iconSize = new GSize(42, 68); crimesAtuais[k].getIcon().iconAnchor = new GPoint(13, 66); } else { crimesAtuais[k].getIcon().image = "./images/baloes/novoMarcadorVerde.png"; crimesAtuais[k].getIcon().iconSize = new GSize(29, 39); crimesAtuais[k].getIcon().iconAnchor = new GPoint(9, 38); } } } } function mostrarCrimeMapa(chave,lat, lng){ //********************************** KERNEL MAP INICIO ********************************************* if(kernelEnabled){ desativaMapaKernel(); } //********************************** KERNEL MAP FIM ************************************************ eventId=chave; eventType='crime'; if(lat != undefined && lng != undefined){ var latLngGM = new google.maps.LatLng(lat,lng); preparaRequisicaoMudandoData(latLngGM, zoomLimiteInfMarcadores); }else{ preparaRequisicaoMudandoData(null, zoomLimiteInfMarcadores); } } function mostrarRelatoMapa(chave){ idconf = null; map.closeInfoWindow(); podeCarregarCrimes = false; idRelato=chave; qtd_roubos = 0; qtd_furtos = 0; qtd_outros = 0; qtd_denuncias = 0; submeteRequisicao(); } function mostrarCrimeMapaIndicado(chaveCr){ idconf = null; map.closeInfoWindow(); podeCarregarCrimes = false; id=chaveCr; qtd_roubos = 0; qtd_furtos = 0; qtd_outros = 0; qtd_denuncias = 0; //alert(chave); var myHtml = "<iframe src='./editarCrime.html?chaveCr=" + chaveCr + "' width='400' height='150' frameborder='0'></iframe>"; crimesAtuais[chaveCr].openInfoWindowHtml(myHtml, 600); } function mostrarRelatoMapaIndicado(chave){ idconf = null; map.closeInfoWindow(); podeCarregarCrimes = false; idRelato=chave; qtd_roubos = 0; qtd_furtos = 0; qtd_outros = 0; qtd_denuncias = 0; //alert(chave); var myHtml = "<iframe src='./editarRelato.html?chave=" + chave + "' width='400' height='150' frameborder='0'></iframe>"; crimesAtuais[chave].openInfoWindowHtml(myHtml, 600); } var statusLegenda='visivel'; function mostraEscondeLeganda(){ if(statusLegenda=='visivel'){ statusLegenda = 'invisivel'; wikicrimesDiv.innerHTML = htmlLegendaEscondida(); } else{ statusLegenda='visivel'; wikicrimesDiv.innerHTML = htmlLegenda(); //*********************** Kernel Map INICIO **************************** //corrigir o bug qd esconde e mostra a legenda do kernel e os numeros zeravam //if(kernelEnabled) //atualizaLegendaKernel(); //*********************** Kernel Map FIM **************************** } } function esconderMensagem(){ document.getElementById("divAvisosNoMapa").style.visibility = "hidden"; } function mostrarMensagem(descricao, tamanhoTela){ document.getElementById("divAvisosNoMapa").style.width = tamanhoTela; document.getElementById("divInternaAvisosNoMapa").innerHTML=descricao; document.getElementById("divAvisosNoMapa").style.visibility = "visible"; } function htmlLegendaEscondida(){ var html = "<div style='position:absolute;right:10px;bottom:10px;'>"; html+=" <table cellpading='0' cellspacing='0' style='width:100px; padding:4px ;border:1px solid #333333; opacity: .99; -moz-opacity:0.99; filter: alpha(opacity=99); background-color:white;font-family:Arial, sans-serif; font-size: 11px;'>"; html+=" <tr>"; html+=" <td align='center' colspan='2'> <b>"+ "#{messages['wikicrimes.legenda.mapa']}" +"</b> <img width='12px' height='12px' src='./images/maximizar.png' onclick='mostraEscondeLeganda();' style='font-size: 12px;cursor: pointer;'/></td>"; html+=" </tr>" html += " </table>"; html+=" </div>"; return html; } function htmlLegenda(){ //*********************** Kernel Map INICIO **************************** //mostrar a legenda do mapa de kernel, se ele tiver ligado if(kernelEnabled) return htmlLegendaKernel(); else //*********************** Kernel Map FIM **************************** return htmlLegendaMarcadores(); } function htmlLegendaMarcadores(){ var html = "<div style='position:absolute;right:10px;bottom:10px;'>"; html+=" <table cellpading='0' cellspacing='0' style='width:100px; padding:4px ;border:1px solid #333333; opacity: .99; -moz-opacity:0.99; filter: alpha(opacity=99); background-color:white;font-family:Arial, sans-serif; font-size: 11px;'>"; html+=" <tr>"; html+=" <td align='center' colspan='2'> <b >"+ "#{messages['wikicrimes.legenda.mapa']}" +"</b> <img width='12px' height='12px' src='./images/maximizar.png' onclick='mostraEscondeLeganda();' style='font-size: 12px;cursor: pointer;'/> </td>"; html+=" </tr>" html+=" <tr>"; html+=" <td align='center'> <img width='14px' height='24px' src='./images/baloes/novoMarcadorVermelha.png' /> </td> <td> "+ "#{messages['tipocrime.roubo']}" +" </td>"; html+=" </tr>" html+=" <tr>"; html+=" <td align='center'> <img width='14px' height='24px' src='./images/baloes/novoMarcadorAzul.png' /> </td> <td> "+ "#{messages['tipocrime.furto']}" +" </td>"; html+=" </tr>" html+=" <tr>"; html+=" <td align='center'> <img width='14px' height='24px' src='./images/baloes/novoMarcadorLaranja.png' /> </td> <td> "+ "#{messages['tipocrime.violencia']}" +" </td>"; html+=" </tr>" html+=" <tr>"; html+=" <td align='center'> <img width='14px' height='24px' src='./images/baloes/novoMarcadorVerde.png' /> </td> <td> "+ "#{messages['tipocrime.outro']}" +" </td>"; html+=" </tr>" html += " </table>"; html+=" </div>"; return html; } var wikicrimesDiv; function LegendaWikicrimes(map) { wikicrimesDiv = document.createElement("div"); /* wikicrimesDiv.style.height = "3.8em"; wikicrimesDiv.style.cursor = "pointer"; wikicrimesDiv.style.backgroundImage = "url('./images/logoWikicrimesEmbedded.PNG')"; */ wikicrimesDiv.innerHTML = htmlLegenda(); wikicrimesDiv.index = 1; map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(wikicrimesDiv); } function requisicaoTexto(servletName, params){ http_request = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest; if (http_request.overrideMimeType) http_request.overrideMimeType('text/xml'); http_request.open('POST', servletName, false); http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); http_request.send(params); if (http_request.readyState == 4 && http_request.status == 200){ //console.log('servletName: ' + servletName + ', params: ' + params + ', responseText: ' + http_request.responseText); return http_request.responseText; }else{ //console.log('servletName: ' + servletName + ', params: ' + params + ', status: ' + http_request.status + ', readyState: ' + http_request.readyState); return null; } } function mostrarFiltro(){ openModalFiltro('340', '400', '#{messages['titulo.pesquisaCrimes']}'); } function esconderFiltro(){ closeModalFiltro('modalFiltro'); } /* ]]> */ --></script> </html>
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript"><!-- /* <![CDATA[ */ var arrayCrimesLatLng = new Array(); var index = 0; var lastKernelRequest; var northPixel; var southPixel; var eastPixel; var westPixel; var width; var height; var mapa = '#{messages["webapp.nome.mapa.default"]}'; var satelite = '#{messages["webapp.nome.mapa.satelite"]}'; var hibrido = '#{messages["webapp.nome.mapa.hibrido"]}'; var terreno = '#{messages["webapp.nome.mapa.terreno"]}'; var kernelLabel = '#{messages["webapp.nome.mapa.zonasquentes"]}'; var earth ="3D"; var textoEmbedMapaWikiCrimes = '#{messages["texto.embed.mapa.wikicrimes"]}'; var textoComandoKMLWikiCrimes = '#{messages["texto.kml.mapa.wikicrimes"]}'; var localeWikiCrimes = '#{messages["webapp.locale"]}'; //var aindaCarregando = false; var me; var kernelLayer; var kernelDiv; var kernelModifiedByUser = false; //usuario mudou o kernel pelo botao var podeMudarModoKernel = true; //pq qd abre a janela arearisco, tem que ficar sempre kernel desligado var defaultFilter = true; //limitar o filtro pra 1000 crimes se o usuario nao especificar nada no filtro (setado pra true sempre q o usuario faz busca) function ativaMapaKernel(primeiraVez){ if(!kernelEnabled){ kernelEnabled = true; selecionarComando(map, 'kernel'); limpaCrimesAgrupador(); document.getElementById("divTelaFiltro").style.visibility = "hidden"; aindaCarregando = true; podeCarregarCrimes=true; if(statusLegenda=='visivel') wikicrimesDiv.innerHTML = htmlLegenda(); if(!primeiraVez){ pintaMapaKernel(); } if(!isJanelaAreaRiscoVisible()) ativaMarcacaoHotspot(); } } function desativaMapaKernel(){ if(podeCarregarCrimes) { removeHintComandosMapa(); kernelEnabled = false; mostraCrimesAgrupador(); selecionarComando(map, 'mao'); apagaMapaKernel(); mostraMarcadores(); podeCarregarCrimes=true; if(statusLegenda=='visivel') wikicrimesDiv.innerHTML = htmlLegenda(); if(!isJanelaAreaRiscoVisible()) desativaMarcacaoHotspot(); } } function crimeKernelMap(lng, lat, crimeMarker){ this.lng = lng; this.lat = lat; this.crimeMarker = crimeMarker; } function zeraArrayCrimes(){ arrayCrimesLatLng = new Array(); index = 0; desativaMapaKernel(); desabilitaBotaoKernel(); } function desabilitaBotaoKernel(){ if (me != null && me.kernelLayer != null){ me.kernelLayer.disable(); me.toggleButton_(kernelDiv.firstChild, me.kernelLayer.getEnabled()); } } function apagaMapaKernel(){ if(overlayKernel){ overlayKernel.setMap(null); if(!isJanelaAreaRiscoVisible()) desmarcaHotspot(); } } function pintaMapaKernel(){ exibeImagemMapaKernel(); if(statusLegenda=='visivel'){ //atualizaLegendaKernel(); } } function updateStatistics(eventId, eventType){ updateKernelMode(eventId); var url = buildStatisticsUrl(eventId, eventType); //console.log("update " + url); var req = requestStatistics(url); if (req.readyState == 4 && req.status == 200){ statistics = eval("(" + req.responseText + ")"); if(kernelEnabled){ uncompressBooleanGrid(); }else{ constroiMarcadores(); } } } function updateKernelMode(eventId){ if(kernelModifiedByUser){ kernelModifiedByUser = false; return; } var shouldEnable; if(eventId){ shouldEnable = false; }else if(map.getZoom() <= zoomLimiteSupKernel){ shouldEnable = true; }else if(map.getZoom() <= zoomLimiteInfMarcadores){ shouldEnable = false; }else{ shouldEnable = false; } if(podeMudarModoKernel) if(shouldEnable){ ativaMapaKernel(); }else{ desativaMapaKernel(); } } function uncompressBooleanGrid(){ var str = statistics.kernel.booleanGrid; if(!str) return; var lines = str.split("\n"); var array = new Array(); for(var i=0; i<lines.length; i++){ array[i] = new Array(); var col = lines[i]; for(var j=0; j<col.length; j++){ array[i][j] = col[j]; } } statistics.kernel.booleanGrid = array; } //grid compactada /*function getBooleanGrid(){ var url = statistics.kernel.booleanGridUrl; if(!url) return; var doneTransfering = new function(zip){ var extracted = zip.extract(); var reader = extracted.openTextReader(); var i = 0; var j = 0; var grid = new Array(); grid[i] = new Array(); var c = reader.readChar() while(c){ switch(c){ case '\n': i=++; grid[i] = new Array(); break; default: grid[i][j] = c; } c = reader.readLine() } statistics.kernel.booleanGrid = grid; } new ZipFile(url, doneTransfering); }*/ function buildStatisticsUrl(eventId, eventType){ lastKernelRequest = {}; var zoom = map.getZoom(); var url =''; if(kernelEnabled){ url += 'actions=kernel|charts|json'; if(zoom >= minZoomAreasRisco && zoom <= maxZoomAreasRisco){ url += '|polygons'; } url += boundsPixelUrlParams(map); }else{ url += 'actions=events|charts|json'; } if(eventId && eventType){ url += pixelSizeUrlParams(); url += '&eventId=' + eventId + '&eventType=' + eventType; url += '&zoom=' + zoomLimiteInfMarcadores; }else{ url += boundsLatLngUrlParams(map); url += '&zoom=' + zoom; lastKernelRequest.zoom = zoom; } url += parametrosFiltroCrimes(); return url; } function pixelSizeUrlParams(){ var div = document.getElementById("map"); var w = div.clientWidth; var h = div.clientHeight; return "&widthPixel=" + w + "&heightPixel=" + h; } function parametrosFiltroCrimes(){ submeteu=false; tipoCrime = document.getElementById("tipoCrime").value; tipoVitima = document.getElementById("tipoVitima").value; tipoLocal = document.getElementById("tipoLocal").value; dataInicial = document.getElementById("dataInicial").value.split("/"); dataFinal = document.getElementById("dataFinal").value.split("/"); horarioInicial = document.getElementById("filtroForm:horarioInicial").value; horarioFinal = document.getElementById("filtroForm:horarioFinal").value; entidadeCertificadora = document.getElementById("filtroForm:entidadeCertificadora").value; var isEntidadeCertificadoraSelecionada = document.getElementById("filtroForm:crimeConfirmadoEntidadeCertificadora").checked; if(isEntidadeCertificadoraSelecionada == false) { document.getElementById("filtroForm:entidadeCertificadora").disabled = true; document.getElementById("filtroForm:entidadeCertificadora").value=""; entidadeCertificadora = "-1"; } if (document.getElementById("filtroForm:crimeConfirmadoPositivamente").checked == true ) confirmadosPositivamente = document.getElementById("filtroForm:crimeConfirmadoPositivamente").value; else confirmadosPositivamente = ""; return '&tc='+tipoCrime+'&tv='+tipoVitima+'&tl='+document.getElementById("tipoLocal").value+'&di='+dataInicial+'&df='+dataFinal+'&hi='+horarioInicial+'&hf='+horarioFinal + '&z=' + map.getZoom()+ '&ec=' + entidadeCertificadora + '&cp=' + confirmadosPositivamente +'&id=' + ignoraData + '&defilter=' + defaultFilter; } function boundsPixelUrlParams(map){ var bounds = map.getBounds(); //Passa os limites para pixel var nePixel = latlngToPixel(bounds.getNorthEast()); var swPixel = latlngToPixel(bounds.getSouthWest()); northPixel = nePixel.y; southPixel = swPixel.y; eastPixel = nePixel.x; westPixel = swPixel.x; var str = '&northPixel=' + northPixel + '&southPixel=' + southPixel + '&eastPixel=' + eastPixel + '&westPixel=' + westPixel; lastKernelRequest.north = northPixel; lastKernelRequest.south = southPixel; lastKernelRequest.west = westPixel; lastKernelRequest.east = eastPixel; //altura e largra var centroLatLng = bounds.getCenter(); var centroPixel = latlngToPixel(centroLatLng); var width = (eastPixel - westPixel); var height = (southPixel - northPixel); //correcao problema das emendas do mapa (linhas com latitude 0 e longitude 0) if(width < 0) width = centroPixel.x < westPixel ? 2*(eastPixel-centroPixel.x) : 2*(centroPixel.x-westPixel); if(height < 0) height = centroPixel.y < southPixel ? 2*(northPixel-centroPixel.y) : 2*(centroPixel.y-southPixel); str +='&widthPixel='+width+'&heightPixel='+height; return str; } function sizePixel(bounds){ //Passa os limites para pixel var nePixel = latlngToPixel(bounds.getNorthEast()); var swPixel = latlngToPixel(bounds.getSouthWest()); northPixel = nePixel.lat(); southPixel = swPixel.lat(); eastPixel = nePixel.lng(); westPixel = swPixel.lng(); //altura e largra var centroLatLng = bounds.getCenter(); var centroPixel = latlngToPixel(centroLatLng); var width = (eastPixel - westPixel); var height = (southPixel - northPixel); //correcao problema das emendas do mapa (linhas com latitude 0 e longitude 0) if(width < 0) width = centroPixel.lng() < westPixel ? 2*(eastPixel-centroPixel.lng()) : 2*(centroPixel.lng()-westPixel); if(height < 0) height = centroPixel.lat() < southPixel ? 2*(northPixel-centroPixel.lat()) : 2*(centroPixel.lat()-southPixel); var size = {w : width, h : height}; return size; } function boundsLatLngUrlParams(map){ var bounds = map.getBounds(); //norte, sul, leste, oeste var neLatLng = bounds.getNorthEast(); var swLatLng = bounds.getSouthWest(); northLatLng = neLatLng.lat(); southLatLng = swLatLng.lat(); eastLatLng = neLatLng.lng(); westLatLng = swLatLng.lng(); var str = '&northLatLng=' + northLatLng + '&southLatLng=' + southLatLng + '&eastLatLng=' + eastLatLng + '&westLatLng=' + westLatLng; //altura e largra var centroLatLng = bounds.getCenter(); var width = (eastLatLng - westLatLng); var height = (southLatLng - northLatLng); //correcao problema das emendas do mapa (linhas com latitude 0 e longitude 0) if(width < 0) width = centroLatLng.lng() < westLatLng ? 2*(eastLatLng-centroLatLng.lng()) : 2*(centroLatLng.lng()-westLatLng); if(height < 0) height = centroLatLng.lat() < southLatLng ? 2*(northLatLng-centroLatLng.lat()) : 2*(centroLatLng.lat()-southLatLng); str +='&widthLatLng='+width+'&heightLatLng='+height; return str; } function pontosUrlParam(){ var str = '&pontoXY='; var arrayCrimesPixel = crimesTelaPixel(); //Monta os parametros da requisicao contendo todos os crimes clicados na tela for (i = 0; i < arrayCrimesPixel.length; i++){ //Crimes sao adicionados como strings separados por "a" e os latlng separados por "," str += arrayCrimesPixel[i].lng + "," + arrayCrimesPixel[i].lat + "a"; } if(arrayCrimesPixel.length > 0) str = str.substring(0, str.length-2); return str; } function pontosLatLngUrlParam(bounds){ var str = "&pontosLatLng="; //Monta os parametros da requisicao contendo todos os crimes clicados na tela var cont = 0; for (i=0; i < arrayCrimesLatLng.length; i++){ //Crimes sao adicionados como strings separados por "|" e os latlng separados por "," var latlng = new google.maps.LatLng(arrayCrimesLatLng[i].lat, arrayCrimesLatLng[i].lng); if(bounds.containsLatLng(latlng)){ str += latlng.lat() + "," + latlng.lng() + "|"; cont++; } } if(str.charAt(str.length-1) == '|') str = str.substring(0, str.length-2); return str; } function requestStatistics(url) { http_request = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest; if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } //Espera retorno do servidor http_request.open('POST', 'statistics', false); http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); http_request.send(url); return http_request; } var overlayKernel = null; function exibeImagemMapaKernel(){ var bounds = map.getBounds(); removeHintComandosMapa(); var optsOverlay = null; if(navigator.appName == 'Microsoft Internet Explorer'){ optsOverlay = {percentOpacity:50}; }else{ optsOverlay = {percentOpacity:100}; } if(!overlayKernel){ overlayKernel = new ProjectedOverlay(map,"statistics?actions=image&nocache=" + new Date().getTime(), bounds, optsOverlay); }else{ overlayKernel.setMap(null); overlayKernel = new ProjectedOverlay(map,"statistics?actions=image&nocache=" + new Date().getTime(), bounds, optsOverlay); } google.maps.event.trigger(map, "idle"); } function validateKernelImage(){ var bounds = map.getBounds(); var nePixel = latlngToPixel(bounds.getNorthEast()); var swPixel = latlngToPixel(bounds.getSouthWest()); if(lastKernelRequest.zoom == map.getZoom() && lastKernelRequest.north == nePixel.y && lastKernelRequest.south == swPixel.y && lastKernelRequest.east == nePixel.x && lastKernelRequest.west == swPixel.x) return true; else return false; } function escondeMarcadores(){ for (i = 0; i < arrayCrimesLatLng.length; i++){ //arrayCrimesLatLng[i].crimeMarker.hide(); } } function mostraMarcadores(){ for (i = 0; i < arrayCrimesLatLng.length; i++){ //arrayCrimesLatLng[i].crimeMarker.show(); } } function limpaCrimesAgrupador(){ // map.clearOverlays(); for (k in crimesAtuais) { crimesAtuais[k].setMap(null); } } function mostraCrimesAgrupador(){ for (k in crimesAtuais) { crimesAtuais[k].setMap(map); } atualizaMapa(); } function crimesTelaPixel(){ //Apaga o array de pixel arrayCrimesPixel = new Array(); //recupera o zoom atual var zoom = map.getZoom(); bounds = map.getBounds(); for (i=0, j=0; i < arrayCrimesLatLng.length; i++){ //Convete o latlng em pixel var latlng = new google.maps.LatLng(arrayCrimesLatLng[i].lat, arrayCrimesLatLng[i].lng); var sw = map.getProjection().fromLatLngToPoint(latlng, zoom); arrayCrimesLatLng[i].crimeMarker.hide(); pontoXPixel = sw.y; //Longitude (x) pontoYPixel = sw.x; //Latitude (y) //So os crimes exibidos na tela atual //if(westPixel <= pontoYPixel && eastPixel >= pontoYPixel && northPixel <= pontoXPixel && southPixel >= pontoXPixel){ /*testeconsole.log(bounds.containsLatLng(latlng) + "; " + "bounds: " + bounds.getNorthEast() + ", " + bounds.getSouthWest() + "; " + "latlng: " + latlng.lat() + ", " + latlng.lng() );/*teste*/ if(bounds.containsLatLng(latlng)){ arrayCrimesPixel[j] = new crimeKernelMap(pontoXPixel, pontoYPixel); j++; } } //console.log("arrayCrimesPixel.length:" + arrayCrimesPixel.length + ", arrayCrimesLatLng.length:" + arrayCrimesLatLng.length); return arrayCrimesPixel; } //****************************************************************** //INFORMACOES DO MAPA DE KERNEL var statistics; var densLimiteInfKernel = .01; //se a densMax for menor que isso, o mapa de kernel nao deve ser exibido (pra evitar hotspots de poucos crimes) var densLimiteSupMarcadores = .01; var zoomLimiteSupKernel = 16; var zoomLimiteInfMarcadores = 17; //****************************************************************** //LEGENDA function htmlLegendaKernel(){ var html = "<div style='position:absolute;right:10px;bottom:10px;'>"; html+=" <table cellpading='0' cellspacing='0' style='width:110px; padding:4px ;border:1px solid #333333; opacity: .99; -moz-opacity:0.99; filter: alpha(opacity=99); background-color:white;font-family:Arial, sans-serif; font-size: 11px;'>"; html+=" <tr>"; html+=" <td align='center' colspan='2'> <b id='tituloLegenda'> #{messages['wikicrimes.legenda.densidade']}" +"</b> <img width='12px' height='12px' src='./images/maximizar.png' onclick='mostraEscondeLeganda();' style='font-size: 12px;cursor: pointer;'/> </td>"; html+=" </tr>"; html+=" <tr align='left'>"; html+=" <td align='right'> <img style='width:20px; height:6em;' src='./images/gradiente2.png' />"; html+=" <td align='left' id='valoresLegendaKernel' >"; html+=" <table align='left' cellpading='0' cellspacing='0' style='padding:4px;'>"; html+=" <tr> <td> #{messages['wikicrimes.legenda.densidade.alta']} </td> </tr>"; html+=" <tr> <td>   </td></tr>"; html+=" <tr> <td> #{messages['wikicrimes.legenda.densidade.media']} </td> </tr>"; html+=" <tr> <td>   </td></tr>"; html+=" <tr> <td> #{messages['wikicrimes.legenda.densidade.baixa']} </td> </tr>"; html+=" </table>"; html+=" </td>"; html+=" </tr>"; html+=" </table>"; html+=" </div>" return html; } function atualizaLegendaKernel(){ var kernel = statistics.kernel; var html="<table align='left' cellpading='0' cellspacing='0' style='padding:4px;'>"; html+=" <tr> <td>"+ arredonda(kernel.maxDensity) + "</td> </tr>"; html+=" <tr><td>   </td></tr>"; html+=" <tr> <td>"+ arredonda(kernel.avgDensity) + "</td> </tr>"; html+=" <tr><td>   </td></tr>"; html+=" <tr> <td>"+ arredonda(kernel.minDensity) + "</td> </tr>"; html+="</table>"; var div = document.getElementById('valoresLegendaKernel'); if(div) div.innerHTML = html; } function arredonda(num){ return Math.round(10000*num)/100; } //****************************************************************** //UTILIDADES function pixelToLatlng(pixel, zoom){ var proj = map.getProjection(); if(zoom) return proj.fromPointToLatLng(pixel); else return proj.fromPointToLatLng(pixel); } function latlngToPixel(latlng, zoom){ var proj = map.getProjection(); return proj.fromLatLngToPoint(latlng); } //Criar mancha google maps V3 function ProjectedOverlay(map, imageUrl, bounds, opts) { google.maps.OverlayView.call(this); this.map_ = map; this.url_ = imageUrl; this.bounds_ = bounds; this.addZ_ = opts.addZoom || ''; // Add the zoom to the image as a parameter this.id_ = opts.id || this.url_; // Added to allow for multiple images this.percentOpacity_ = opts.percentOpacity || 50; this.setMap(map); } ProjectedOverlay.prototype = new google.maps.OverlayView(); ProjectedOverlay.prototype.createElement = function() { var panes = this.getPanes(); var div = this.div_; if (!div) { div = this.div_ = document.createElement("div"); div.style.position = "absolute"; div.setAttribute('id', this.id_); this.div_ = div; this.lastZoom_ = -1; if (this.percentOpacity_) { this.setOpacity(this.percentOpacity_); } panes.overlayLayer.appendChild(div); } }; // Remove the main DIV from the map pane ProjectedOverlay.prototype.remove = function() { if (this.div_) { this.setMap(null); this.div_.parentNode.removeChild(this.div_); this.div_ = null; } }; // Redraw based on the current projection and zoom level... ProjectedOverlay.prototype.draw = function(firstTime) { // Creates the element if it doesn't exist already. this.createElement(); if (!this.div_) { return; } var c1 = this.get('projection').fromLatLngToDivPixel( this.bounds_.getSouthWest()); var c2 = this.get('projection').fromLatLngToDivPixel( this.bounds_.getNorthEast()); if (!c1 || !c2) return; // Now position our DIV based on the DIV coordinates of our bounds this.div_.style.width = Math.abs(c2.x - c1.x) + "px"; this.div_.style.height = Math.abs(c2.y - c1.y) + "px"; this.div_.style.left = Math.min(c2.x, c1.x) + "px"; this.div_.style.top = Math.min(c2.y, c1.y) + "px"; // Do the rest only if the zoom has changed... if (this.lastZoom_ == this.map_.getZoom()) { return; } this.lastZoom_ = this.map_.getZoom(); var url = this.url_; if (this.addZ_) { url += this.addZ_ + this.map_.getZoom(); } this.div_.innerHTML = '<img src="' + url + '" width=' + this.div_.style.width + ' height=' + this.div_.style.height + ' >'; }; ProjectedOverlay.prototype.setOpacity = function(opacity) { if (opacity < 0) { opacity = 0; } if (opacity > 100) { opacity = 100; } var c = opacity / 100; if (typeof (this.div_.style.filter) == 'string') { this.div_.style.filter = 'alpha(opacity:' + opacity + ')'; } if (typeof (this.div_.style.KHTMLOpacity) == 'string') { this.div_.style.KHTMLOpacity = c; } if (typeof (this.div_.style.MozOpacity) == 'string') { this.div_.style.MozOpacity = c; } if (typeof (this.div_.style.opacity) == 'string') { this.div_.style.opacity = c; } }; /* ]]> */ --></script> </html>
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="scripts/dragresize.js"/> <script type="text/javascript"> /* <![CDATA[ */ var polyHotspot; //poligono q aparece qd passa o mouse sobre um hotspot var polyEditando; //poligono q foi gravado pelo usuario como uma de suas "Areas de Risco" var idPolyEditando; //id da AreaRisco do polyEditando var nomePolyEditando; //nome da AreaRisco do polyEditando var minZoomAreasRisco = 11; var maxZoomAreasRisco = 14; //****************************************************************** //MARCACACAO DE HOTSPOT var mousemoveHotspot; var clickHotspot; var isMouseNoHotspot; var posHintHotspot; var corPoly1 = '#0000FF'; //cor do poligono novo, ao passar o mouse nos hotspots var corPoly2 = '#0000FF'; //cor do poligono salvo, areas gravadas pelo usuario //roxo #800080 //brick #B22222 //azul #0000FF function ativaMarcacaoHotspot(){ //mousemove listener mousemoveHotspot = google.maps.event.addListener(map, "mousemove", function(event) { //marcar apenas em determinados niveis zoom var zoom = map.getZoom(); if(zoom < minZoomAreasRisco || zoom > maxZoomAreasRisco){ return; } //nao marcar por cima de um poligono de area salva if(isMinhasAreasExibindo && minhasAreas){ for(i=0; i<minhasAreas.length; i++){ var teste = minhasAreas[i]; if(minhasAreas[i].poligono.contains(event.latLng)){ return; } } } //nao marcar denovo se ja tiver um poligono marcado (o mouse esta sobre ele) if(polyHotspot && polyHotspot.contains(event.latLng)){ return; } if(polyHotspot != null){ desmarcaHotspot(); } var posGrid = latLongToGrid(event.latLng); //posicao no grid de densidades correspondente a posicao do mouse isMouseNoHotspot = isCelulaNoHotspot(posGrid); if(isMouseNoHotspot){ marcaHotspot(posGrid); //document.getElementById("map").style.cursor = 'hand'; //nao funcionou } }); } function desativaMarcacaoHotspot(){ if(mousemoveHotspot) google.maps.event.removeListener(mousemoveHotspot); } function marcaHotspot(posGrid){ var contorno = encontraContorno(posGrid); if(contorno == null) return; polyHotspot = new google.maps.Polygon({ paths: contorno, strokeColor: corPoly1, strokeWeight: 5, strokeOpacity: 0.4, fillColor: corPoly1, fillOpacity: 0.2, }); polyHotspot.setMap(map); //polyHotspot = new google.maps.Polygon(contorno, corPoly1, 5, .4, corPoly1, .2)//, '#0000FF', 5, 0.4, '#0000FF', 0.2);//GPolygon(latlngs:GLatLng[], strokeColor?:String, strokeWeight?:Number, strokeOpacity?:Number, fillColor?:Number, fillOpacity?:Number, opts?:GPolygonOptions) if(isMinhasAreasExibindo){ esconderMinhasAreas(); exibirMinhasAreas(); } //click listener clickHotspot = google.maps.event.addListener(polyHotspot, "click", function(event) { var msg = "#{messages['areasrisco.login']}" //console.log('areasRisco.xhtml, 0'); var precisouLogin = loginCasoPrecise('5', msg); if(precisouLogin){ //exibirMinhasAreas(); //exibirJanelaAreaRisco('Salvar'); }else{ google.maps.event.removeListener(clickHotspot); exibirJanelaAreaRisco('Salvar'); } }); //so pro ponteiro do mouse ficar "hand" hostpostPointer = google.maps.event.addListener(polyHotspot, "mouseover", function(event){ }); //mostra hint posHintHotspot = polyHotspot.getPath().getAt(0); mostraHintMarcacaoHotspot(posHintHotspot); } var hostpostPointer; var podeDesmarcarHotspot = true; function desmarcaHotspot(){ if(!polyHotspot || !podeDesmarcarHotspot) return; google.maps.event.removeListener(clickHotspot); google.maps.event.removeListener(hostpostPointer); //listener q faz o ponteiro do mouse ficar hand no polyHotspot polyHotspot.setMap(null); polyHotspot = null; //esconde hint removeHint(); } //****************************************************************** //LOGIGA PRA MARCAR CONTORNO DO HOTSPOT function encontraContorno(celulaInicial){ /*//inicializa var visitado = new Array(); var cols = statistics.kernel.cols; for(var i=0; i<cols; i++){ visitado[i] = new Array(); }*/ //encontra o contorno //flood(celulaInicial); var contorno = comerPelasBeiradas(celulaInicial); if(contorno == null) return; //diminui a quantidade de pontos do contorno var passo = 3; var temp = Array(); for(var i=0; i<contorno.length; i+=passo) temp[temp.length] = contorno[i]; temp[temp.length] = temp[0]; return temp; } /* //algoritmo alternativo ao "comerPelasBeiradas" var contorno; var visitado; function flood(celula){ if(visitado[celula.x][celula.y]) return; if(!isCelulaNoHotspot(celula)){ var latlng = gridToLatlng(celula); contorno[contorno.length] = latlng; return; } visitado[celula.x][celula.y] = true; flood(celulaVizinha(celula, norte)); flood(celulaVizinha(celula, sul)); flood(celulaVizinha(celula, leste)); flood(celulaVizinha(celula, oeste)); } */ //TODO tem um problema //em cada passo da caminhada pela borda, n tao sendo processadas so as 3 celulas como na ilustracao 1 (como foi planejado) //ta sendo processado como na ilustracao 2, pq nao ta "voltando" pro "x" antes de ir pra cima e pra esquerda (erro de implementacao mesmo) //so q, ao corrigir isso, para de funcionar //pq acontece com mais frequencia de nao achar "celula fora do hotspot" procurando na area menor (ilustracao 1) // // 1 2 < ^ // ^ < v < ^ // < x > V > x > // V > function comerPelasBeiradas(celulaInicial){ //inicializa var contorno = new Array(); //encontra uma celula qualquer da borda a partir da celula inicial (que esta no meio do hotspot) var celula = celulaInicial; while(isCelulaNoHotspot(celula)){ celula = celulaVizinha(celula, norte); //celula vizinha ao norte } //inclui a primeira celula encontrada var direcao = norte; contorno[contorno.length] = gridToLatlng(celula); var primeira = celula; //usado na condicao de parada var cont = 0; //caminha pela borda ate fechar um 'ciclo' (voltar pra origem) do{ direcao = oposta(direcao); //direcao oposta (de onde veio) for(var i=0; i<3;i++){ //primeiro pra direita, depois pra frente, depois pra esquerda direcao = prox(direcao); celula = celulaVizinha(celula, direcao); if(!isCelulaNoHotspot(celula)){ //a primeira que satisfizer esta condicao faz parte da borda contorno[contorno.length] = gridToLatlng(celula); break; } } //se o algoritmo se perder, ignora e retorna null; cont++; if(cont>200){ //alert('cont='+cont); return null; } }while(celula.x != primeira.x || celula.y != primeira.y); return contorno; } function isCelulaNoHotspot(celula){ if(statistics == undefined) return; var grid = statistics.kernel.booleanGrid; if(grid == undefined || grid[celula.x] == undefined) return false; var cell = grid[celula.x][celula.y]; return cell == 1; } var norte = 0; var leste = 1; var sul = 2; var oeste = 3; function prox(dir){ //proxima direcao, no sentido horario return (dir+1)%4; } function oposta(dir){ return (dir+2)%4; } function celulaVizinha(celula, dir){ //celula vizinha na direcao passada como argumento switch(dir){ case norte: return new PosicaoGrid(celula.x, celula.y-1); case sul: return new PosicaoGrid(celula.x, celula.y+1); case leste: return new PosicaoGrid(celula.x-1, celula.y); case oeste: return new PosicaoGrid(celula.x+1, celula.y); } } function PosicaoGrid(x,y){ this.x = x; this.y = y; return this; } function latLongToGrid(latlng){ if(statistics == undefined) return; var nodeSize = statistics.kernel.nodeSize; var topRight = map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast()); var bottomLeft = map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest()); var scale = Math.pow(2,map.getZoom()); var worldPoint = map.getProjection().fromLatLngToPoint(latlng); var clickPixel = new google.maps.Point((worldPoint.x-bottomLeft.x)*scale,(worldPoint.y-topRight.y)*scale); //var x = clickPixel.x-westPixel; //var y = clickPixel.y-northPixel; var noX = parseInt(clickPixel.x/nodeSize); var noY = parseInt(clickPixel.y/nodeSize); return new PosicaoGrid(noX,noY); } function gridToLatlng(posGrid){ if(statistics == undefined) return; var nodeSize = statistics.kernel.nodeSize; var topRight = map.getProjection().fromLatLngToPoint(map.getBounds().getNorthEast()); var bottomLeft = map.getProjection().fromLatLngToPoint(map.getBounds().getSouthWest()); var xPixel = bottomLeft.x + posGrid.x * nodeSize; var yPixel = topRight.y + posGrid.y * nodeSize; var posPixel = new google.maps.Point(xPixel,yPixel); var posLatlng = map.getProjection().fromPointToLatLng(posPixel); return posLatlng; } google.maps.Polygon.prototype.contains = function(latLng) { // Outside the bounds means outside the polygon if (this.getBounds && !this.getBounds().contains(latLng)) { return false; } var lat = latLng.lat(); var lng = latLng.lng(); var paths = this.getPaths(); var path, pathLength, inPath, i, j, vertex1, vertex2; // Walk all the paths for (var p = 0; p < paths.getLength(); p++) { path = paths.getAt(p); pathLength = path.getLength(); j = pathLength - 1; inPath = false; for (i = 0; i < pathLength; i++) { vertex1 = path.getAt(i); vertex2 = path.getAt(j); if (vertex1.lng() < lng && vertex2.lng() >= lng || vertex2.lng() < lng && vertex1.lng() >= lng) { if (vertex1.lat() + (lng - vertex1.lng()) / (vertex2.lng() - vertex1.lng()) * (vertex2.lat() - vertex1.lat()) < lat) { inPath = !inPath; } } j = i; } if (inPath) { return true; } } return false; } //****************************************************************** //EDICAO DO POLIGONO /* google.maps.Polygon.prototype.toggleEditing = function() { if(!this.isEditing){ this.enableEditing(); this.isEditing = true; //document.body.style.cursor = "crosshair"; }else{ this.disableEditing(); this.isEditing = false; //document.body.style.cursor = "auto"; } } function alterarFormato(){ if(polyHotspot) polyHotspot.toggleEditing(); if(polyEditando) polyEditando.toggleEditing(); } */ //var isHintAgendado; function mostraHintMarcacaoHotspot(latlng){ if(isMouseNoHotspot && !isJanelaAreaRiscoVisible()){ var msg = "#{messages['areasrisco.tooltip']}"; mostraHintNoMapa(msg, latlng, false); } //isHintAgendado = false; } //****************************************************************** //JANELA PARA EDITAR, SALVAR A MARCACAO OU MANDAR ALERTA var podeAbrirJanelaAreaRisco = true; function exibirJanelaAreaRisco(tipo){ var poly; if(tipo == 'Salvar'){ poly = polyHotspot; podeDesmarcarHotspot = false; }else if(tipo == 'Editar'){ poly = polyEditando; } podeMudarModoKernel = false; if(kernelEnabled){ //desativaMapaKernel(); kernelEnabled = false; apagaMapaKernel(); } removeHint(); zoomNoPoligono(poly); document.getElementById("editarAreaRiscoTituloTD").innerHTML = nomePolyEditando; document.getElementById("editarAreaRiscoDescTD").innerHTML = "#{messages['areasrisco.janela.editar.explicacao']}" + nomePolyEditando; document.getElementById("janela"+tipo+"AreasRisco").style.visibility = "visible"; ativaDragJanelaAreaRisco(tipo); podeAbrirJanelaAreaRisco = false; } function fecharJanelaAreaRisco(tipo){ fecharTodasOpcoesAreasRisco(); limparShareLinks(); fecharOpcaoAreasRisco('salvar'); fecharOpcaoAreasRisco('editarNome'); fecharOpcaoAreasRisco('editarFormato'); fecharOpcaoAreasRisco('excluir'); limparCamposAreaRisco(); document.getElementById("janela"+tipo+"AreasRisco").style.visibility = "hidden"; if(polyHotspot && polyHotspot.isEditing){ polyHotspot.disableEditing(); polyHotspot.isEditing = false; } if(polyEditando && polyEditando.isEditing){ polyEditando.disableEditing(); polyEditando.isEditing = false; } podeCarregarCrimes=false; podeMudarModoKernel = true; //console.log("fechar 1"); recuperarZoom(); //console.log("fechar 2"); podeDesmarcarHotspot = true; podeCarregarCrimes=true; if(polyHotspot){ polyHotspot.setMap(null); polyHotspot = null; } refreshMinhasAreas(); podeAbrirJanelaAreaRisco = true; //GEvent.trigger(map,"moveend"); } function isJanelaAreaRiscoVisible(tipo){ if(tipo == 'Salvar') return document.getElementById("janelaSalvarAreasRisco").style.visibility == "visible"; else if(tipo == 'Editar') return document.getElementById("janelaSalvarAreasRisco").style.visibility == "visible"; else return isJanelaAreaRiscoVisible('Salvar') || isJanelaAreaRiscoVisible('Editar'); } var centroAnterior; //pra posicionar a tela de volta ao fechar a telinha da area de interesse var zoomAnterior; function zoomNoPoligono(poly){ var mapBounds = map.getBounds(); centroAnterior = mapBounds.getCenter(); zoomAnterior = map.getZoom(); var polyBounds = poly.getBounds(); var zoom = map.getBoundsZoomLevel(polyBounds); var centro = polyBounds.getCenter(); var widthJanela = document.getElementById("janelaSalvarAreasRisco").offsetWidth; centro = deslocaLatLng(centro, widthJanela/2, zoom); map.setCenter(centro, zoom); } function deslocaLatLng(latlng, pixelDistance, zoom){ //Desloca um GLatLong pra leste. A distancia do deslocamento eh dada em pixels //*lembrando que pra zooms diferentes, a escala em pixels eh diferente. var pixel = latlngToPixel(latlng, zoom); pixel.x -= pixelDistance; return pixelToLatlng(pixel, zoom); } function recuperarZoom(){ map.setCenter(centroAnterior, zoomAnterior); centroAnterior = null; zoomAnterior = null; } function exibirOpcaoAreasRisco(nome){ fecharTodasOpcoesAreasRisco(); var td = document.getElementById(nome + "AreaRiscoTD"); var div = document.getElementById(nome + "AreaRiscoDIV"); td.appendChild(div); } function fecharOpcaoAreasRisco(nome){ var div = document.getElementById(nome + "AreaRiscoDIV"); var invisivel = document.getElementById("divInvisivel"); invisivel.appendChild(div); } function fecharTodasOpcoesAreasRisco(){ var invisivel = document.getElementById("divInvisivel"); invisivel.appendChild(document.getElementById("salvarAreaRiscoDIV")); invisivel.appendChild(document.getElementById("salvarFormatoAreaRiscoDIV")); invisivel.appendChild(document.getElementById("editarNomeAreaRiscoDIV")); invisivel.appendChild(document.getElementById("editarFormatoAreaRiscoDIV")); invisivel.appendChild(document.getElementById("excluirAreaRiscoDIV")); fecharShareLinks('salvar'); fecharShareLinks('editar'); } function isOpcaoAreasRiscoVisible(nome){ var div = document.getElementById(nome + "AreaRiscoDIV"); return div.parentNode.id == nome + "AreaRiscoTD"; } function toggleOpcaoAreasRisco(nome){ if(isOpcaoAreasRiscoVisible(nome)) fecharOpcaoAreasRisco(nome); else exibirOpcaoAreasRisco(nome); } function atualizaNomeInput(){ var input = document.getElementById("editarNomeInput"); input.value = nomePolyEditando; } function limparCamposAreaRisco(){ document.getElementById("nomeAreaInput").value = ""; document.getElementById("editarNomeInput").value = ""; } //****************************************************************** //SALVAR, EDITAR E CARREGAR "AREAS RISCO" var minhasAreas; var isMinhasAreasExibindo = false; function carregarMinhasAreas(){ minhasAreas = []; var str = requisicaoTexto("ServletAreasRisco", "acao=listar"); if(str.length > 0){ var splitStr = str.split("||"); for(i=0; i<splitStr.length; i++){ var strPoli = splitStr[i]; var splitPoly = strPoli.split("|"); var id = splitPoly[0]; var nome = splitPoly[1]; var vertices = []; for(j=2; j<splitPoly.length; j++){ //pula os 2 primeiros elementos q sao o id e o nome var strPonto = splitPoly[j]; var splitPonto = strPonto.split(","); var latlng = new google.maps.LatLng(splitPonto[0], splitPonto[1]); vertices.push(latlng); } var poli = new google.maps.Polygon(vertices, corPoly2, 5, .8, corPoly2, .4); var area = new AreaRisco(id, nome, poli); minhasAreas.push(area); } } } function exibirMinhasAreas(){ //console.log('areasRisco.xhtml, 8'); if(isMinhasAreasExibindo) return; if(!minhasAreas) carregarMinhasAreas(); for(i=0; i<minhasAreas.length; i++){ var area = minhasAreas[i]; area.show(map); } isMinhasAreasExibindo = true; } function esconderMinhasAreas(){ if(!isMinhasAreasExibindo || !minhasAreas) return; for(i=0; i<minhasAreas.length; i++){ var area = minhasAreas[i]; area.hide(map); } isMinhasAreasExibindo = false; } function toggleExibirMinhasAreas(){ if(isMinhasAreasExibindo) esconderMinhasAreas(); else exibirMinhasAreas(); } function refreshMinhasAreas(){ var tavaExibindo = isMinhasAreasExibindo; esconderMinhasAreas(); carregarMinhasAreas(); if(tavaExibindo) exibirMinhasAreas(); } function limparMinhasAreas(){ esconderMinhasAreas(); minhasAreas = null; } function salvarAreaRisco(){ var nome = document.getElementById("nomeAreaInput").value; var poly = polyHotspot; //construir area e mandar pro servidor var str = "acao=salvar"; str += "&nome=" + nome; str += "&vertices=" + polyToString(poly); var id = requisicaoTexto("ServletAreasRisco", str); refreshMinhasAreas(); //tirar o polyHotspot (vai ser substituido pelo salvo) map.removeOverlay(polyHotspot); polyHotspot = null; } function editarNomeAreaRisco(){ var str = "acao=renomear"; str += "&id="+idPolyEditando; str += "&nome="+document.getElementById("editarNomeInput").value; requisicaoTexto("ServletAreasRisco",str); refreshMinhasAreas(); } function editarFormatoAreaRisco(){ if(polyEditando){ var str = "acao=alterarFormato"; str += "&id="+idPolyEditando; str += "&vertices="+polyToString(polyEditando); requisicaoTexto("ServletAreasRisco",str); } } function excluirAreaRisco(){ var str = "acao=excluir"; str += "&id="+idPolyEditando; requisicaoTexto("ServletAreasRisco",str); map.removeOverlay(polyEditando); refreshMinhasAreas(); fecharJanelaAreaRisco('Editar'); } function polyToString(poly){ var str = ""; for(i=0; i<poly.getVertexCount(); i++){ var v = poly.getVertex(i); str += v.lat() + "," + v.lng() + "|"; } str = str.substr(0, str.length - 1); return str; } function AreaRisco(id, nome, poligono){ this.id = id; this.nome = nome; this.poligono = poligono; poligono.areaRisco = this; this.show = function(map){ map.addOverlay(poligono); this.click = GEvent.addListener(this.poligono, "click", function (latlng) { polyEditando = this; idPolyEditando = id; nomePolyEditando = nome; if(podeAbrirJanelaAreaRisco) exibirJanelaAreaRisco('Editar'); }); //mostra hint this.mouseover = GEvent.addListener(this.poligono, "mouseover", function () { posHint = this.getBounds().getNorthEast(); mostraHintNoMapa(this.areaRisco.nome, posHint, true); desmarcaHotspot(); }); this.mouseout = GEvent.addListener(this.poligono, "mouseout", function () { removeHint(); }); } this.hide = function(map){ map.removeOverlay(poligono); GEvent.removeListener(this.click); } } //****************************************************************** //LINKS PRA SERVICOS (twitter, myspace, etc) function limparShareLinks(){ bufferShareLinks = null; } var bufferShareLinks; function exibirShareLinks(poly, tipo){ fecharTodasOpcoesAreasRisco(); var td = document.getElementById(tipo+"ShareLinksTD"); if(!bufferShareLinks){ td.innerHTML = "<img src='images/loading.gif' style='width:120px;height:15px' />"; //um gif de loading que substitui a divShareLinks, enquanto ela carrega bufferShareLinks = divShareLinks(poly); } td.innerHTML = bufferShareLinks; } function fecharShareLinks(tipo){ tipo = tipo.toLowerCase(); if(isShareLinksVisible()){ var shareLinks = document.getElementById("shareLinksDIV"); var td = document.getElementById(tipo+"ShareLinksTD"); if(shareLinks.parentNode == td) td.removeChild(shareLinks); } } function isShareLinksVisible(){ return document.getElementById("shareLinksDIV") != null; } function toggleShareLinks(poly, tipo){ if(isShareLinksVisible()) fecharShareLinks(tipo); else exibirShareLinks(poly, tipo); } function divShareLinks(poly){ var urlImagem = getUrlImagem(poly); var div = "<div id='shareLinksDIV'>"; for(var i=0; i<shareLinks.length; i++) div += tagImageShareLink(shareLinks[i], urlImagem); div += "</div>"; return div; } var msgShare = ""; function tagImageShareLink(link, urlImagem){ var urlSite = link.url; urlSite = urlSite.replace("%url", escape(urlImagem)); urlSite = urlSite.replace("%texto", escape(msgShare)); var tag = "<img src=\"images/icones_sites/" + link.id + "_32.png\" " + "onclick=\"window.open('" + urlSite + "', '_blank');\" " + "style=\"cursor:pointer\" alt=\"" + link.nome + "\" />"; return tag; } var shareLinks = [ {id:'twitter', nome:'Twitter', url:'http://twitter.com/home?status=%texto (%url)'}, {id:'myspace', nome:'Myspace', url:'http://www.myspace.com/Modules/PostTo/Pages/?u=%url&t=%texto'}, {id:'facebook', nome:'Facebook', url:'http://www.facebook.com/sharer.php?u=%url'}, {id:'google', nome:'Google', url:'http://www.google.com/bookmarks/mark?op=add&bkmk=%url&title=%texto'}, {id:'delicious', nome:'Delicious', url:'http://del.icio.us/post?url=%url&title=%texto'}, //{id:'blinklist', nome:'Blinklist', url:'http://blinklist.com/index.php?Action=Blink/addblink.php&Description=&Url=%url&title=%texto'}, //{id:'furl', nome:'Furl', url:'http://www.furl.net/storeIt.jsp?&u=%url&t=%texto'}, //{id:'technorati',nome:'Technorati', url:'http://technorati.com/faves?add=&url'}, //{id:'magnolia', nome:'Magnolia', url:'http://ma.gnolia.com/beta/bookmarklet/add?url=%url&title=%texto'}, //{id:'sphinn', nome:'Sphinn', url:'http://sphinn.com/submit.php?url=%url&title=%texto'}, //{id:'mixx', nome:'Mixx', url:'http://www.mixx.com/submit?page_url=%url&title=%texto'}, {id:'qrcode', nome:'QR Code', url:'qrcodegen.html?string=%url' + escape('&qr=true')} ]; function getUrlImagem(poly){ //imagem do Google Static Maps API var bounds = poly.getBounds(); var centro = bounds.getCenter(); var size = sizePixel(bounds); var width = size.w; var height = size.h; var zoom = map.getZoom(); //bounds var north = bounds.getNorthEast().lat(); var east = bounds.getNorthEast().lng(); var south = bounds.getSouthWest().lat(); var west = bounds.getSouthWest().lng(); //requisicao pro servlet ServletMapaEstatico (ou MapImage) var paramsGerar = "acao=novaImagem" + "&north=" + north + "&south=" + south + "&east=" + east + "&west=" + west + "&width=" + width + "&height=" + height + "¢roLng=" + centro.lng() + "¢roLat=" + centro.lat() + "&zoom=" + zoom + "&poligono=" + polyToString(poly); //pontosLatLngUrlParam(bounds); var urlMapaComKernel = requisicaoTexto("ServletImagemMapa", paramsGerar); return urlMapaComKernel; } //****************************************************************** //DRAG function ativaDragJanelaAreaRisco(tipo){ var div = document.getElementById('janela'+ tipo +'AreasRisco'); var espacoExtra = div.offsetWidth - 50; var size = getBrowserWindowSize(); var config = { minLeft: -espacoExtra, minTop: 0, maxLeft:size.width + espacoExtra, maxTop:size.height + espacoExtra, } var dragresize = new DragResize('dragresize', config); dragresize.isElement = function(elm){ if (elm.className && elm.className.indexOf('divJanelaAreaRisco') > -1) return true; }; dragresize.isHandle = function(elm){ if (elm.className && elm.className.indexOf('headerJanelaAreaRisco') > -1) return true; }; dragresize.apply(document); } function getBrowserWindowSize(){ var w = 0; var h = 0; //IE if(!window.innerWidth) { //strict mode if(!(document.documentElement.clientWidth == 0)) { w = document.documentElement.clientWidth; h = document.documentElement.clientHeight; } //quirks mode else { w = document.body.clientWidth; h = document.body.clientHeight; } } //w3c else { w = window.innerWidth; h = window.innerHeight; } return {width:w,height:h}; } /* ]]> */ </script> <style> .divJanelaAreaRisco { position: absolute; width: 400px; margin-left: auto; margin-right: auto; z-index: 90; opacity: 1.00; -moz-opacity: 1.00; filter: alpha(opacity = 100); color: #000000; font-family: helvetica, verdana, sans; font-size: 12px; visibility: hidden; background-color: #ffffff; } .headerJanelaAreaRisco { cursor: move; } .areas{ padding:5px 15px 15px; } .areas img{ height: 30px; width: 30px; text-align: right; } .areasTitle{ font-size:100%; font-weight:bold; margin-left:7ex; margin-bottom: 5px } .areasLink{ vertical-align: bottom; } .areasHint{ vertical-align: top; } .areas a{ cursor:pointer; } .areas{ font-size: 13px; } .drsElement { position: absolute; } .drsMoveHandle { cursor: move; } </style> </head> <body> <div id="janelaSalvarAreasRisco" class="divJanelaAreaRisco" style="left:5%; top:20%">
<HtmlPanel id="j_id12" rendered="true" style="width:100%; height:100%; border-width:medium; border-color:#3a6bb4; border-style:solid;" transient="false">
header
<HtmlPanelGroup id="j_id13" rendered="true" transient="false">
<table width="100%" class="headerJanelaAreaRisco"><tr> <td align="center" style="width:100%">
<HtmlOutputText escape="true" id="j_id15" rendered="true" transient="false" value="Risk area identified by the system"/>
</td> <td align="right">
<HtmlGraphicImage id="j_id17" ismap="false" onclick="fecharJanelaAreaRisco('Salvar')" rendered="true" style="cursor:pointer;" transient="false" url="/images/close.gif" value="/images/close.gif"/>
</td> </tr></table>
</HtmlPanelGroup>
<table width="100%" class="areas"> <tr> <td colspan="2" width="100%" style="vertical-align:bottom;"> <img src="images/areaRisco.png" style="width:45px; height:45px; float:left;"/> <p class="areasTitle"> #{messages['areasrisco.janela.salvar.explicacao']} </p> </td> </tr> <tr> <td colspan="2" style="font-size:20; font-weight:bold;"> #{messages['areasrisco.janela.vcpode']} </td> </tr> <tr height="10"/> <tr> <td rowspan="2" align="right"> <a onclick="toggleOpcaoAreasRisco('salvar')"> <img src="images/tag.png" style="height: 35px;width: 35px;"/> </a> </td> <td class="areasLink"> <a onclick="toggleOpcaoAreasRisco('salvar')"> #{messages['areasrisco.janela.nomear']} </a> </td> </tr> <tr> <td class="areasHint"> #{messages['areasrisco.janela.nomear.explicacao']} </td> </tr> <tr> <td id="salvarAreaRiscoTD" align="center" colspan="2"/> </tr> <tr height="10"/> <tr> <td rowspan="2" align="right"> <a onclick="toggleShareLinks(polyHotspot, 'salvar');"> <img src="images/warning.png"/> </a> </td> <td class="areasLink"> <a onclick="toggleShareLinks(polyHotspot, 'salvar');"> #{messages['areasrisco.janela.alertar']} </a> </td> </tr> <tr> <td class="areasHint"> #{messages['areasrisco.janela.alertar.explicacao']} </td> </tr> <tr> <td id="salvarShareLinksTD" align="center" colspan="2"/> </tr> <tr height="10"/> <tr> <td rowspan="2" align="right"> <a onclick="alterarFormato();toggleOpcaoAreasRisco('salvarFormato');"> <img src="images/resize.png"/> </a> </td> <td class="areasLink"> <a onclick="alterarFormato();toggleOpcaoAreasRisco('salvarFormato');"> #{messages['areasrisco.janela.limites']} </a> </td> </tr> <tr> <td class="areasHint"> #{messages['areasrisco.janela.limites.explicacao']} </td> </tr> <tr> <td id="salvarFormatoAreaRiscoTD" align="center" colspan="2"/> </tr> <tr height="10"/> </table>
</HtmlPanel>
</div> <div id="divInvisivel" style="visibility:hidden; position:absolute"> <div id="salvarAreaRiscoDIV"> <input id="nomeAreaInput" type="text"/> <button onclick="salvarAreaRisco();fecharOpcaoAreasRisco('salvar')"> #{messages['comum.gravar']} </button> </div> <div id="salvarFormatoAreaRiscoDIV"> #{messages['areasrisco.janela.limites.dica']} <button onclick="editarFormatoAreaRisco();fecharOpcaoAreasRisco('salvarFormato');"> #{messages['comum.confirmar']} </button> </div> <div id="editarNomeAreaRiscoDIV"> <input id="editarNomeInput" type="text"/> <button onclick="editarNomeAreaRisco();fecharOpcaoAreasRisco('editarNome');"> #{messages['comum.confirmar']} </button> </div> <div id="editarFormatoAreaRiscoDIV"> #{messages['areasrisco.janela.limites.dica']} <button onclick="editarFormatoAreaRisco();fecharOpcaoAreasRisco('editarFormato');"> #{messages['comum.confirmar']} </button> </div> <div id="excluirAreaRiscoDIV"> #{messages['areasrisco.janela.excluir.confirma']} <button onclick="excluirAreaRisco();fecharOpcaoAreasRisco('excluir');"> #{messages['webapp.btn.sim']} </button> <button onclick="fecharOpcaoAreasRisco('excluir');"> #{messages['webapp.btn.cancelar']} </button> </div> </div> <div id="janelaEditarAreasRisco" class="divJanelaAreaRisco" style="left:5%; top:20%">
<HtmlPanel id="j_id21" rendered="true" style="width:100%; height:100%; border-width:medium; border-color:#3a6bb4; border-style:solid;" transient="false">
header
<HtmlPanelGroup id="j_id22" rendered="true" transient="false">
<table width="100%" class="headerJanelaAreaRisco"><tr> <td id="editarAreaRiscoTituloTD" align="center" style="width:100%"> </td> <td align="right">
<HtmlGraphicImage id="j_id24" ismap="false" onclick="fecharJanelaAreaRisco('Editar')" rendered="true" style="cursor:pointer;" transient="false" url="/images/close.gif" value="/images/close.gif"/>
</td> </tr></table>
</HtmlPanelGroup>
<table width="100%" class="areas"> <tr> <td colspan="2" width="100%" style="vertical-align:bottom"> <img src="images/areaRisco.png" style="width:45px; height:45px; float:left"/> <p class="areasTitle" id="editarAreaRiscoDescTD"> </p> </td> </tr> <tr> <td colspan="2" style="font-size:20; font-weight:bold;"> #{messages['areasrisco.janela.vcpode']} </td> </tr> <tr height="10"/> <tr> <td rowspan="2" align="right"> <a onclick="atualizaNomeInput();toggleOpcaoAreasRisco('editarNome');"> <img src="images/tag.png" style="height: 35px;width: 35px;"/> </a> </td> <td class="areasLink"> <a onclick="atualizaNomeInput();toggleOpcaoAreasRisco('editarNome');"> #{messages['areasrisco.janela.renomear']} </a> </td> </tr> <tr> <td class="areasHint"> #{messages['areasrisco.janela.renomear.explicacao']} </td> </tr> <tr> <td id="editarNomeAreaRiscoTD" align="center" colspan="2"/> </tr> <tr height="10"/> <tr> <td rowspan="2" align="right"> <a onclick="toggleOpcaoAreasRisco('excluir')"> <img src="images/remove.png" style="height: 35px;width: 35px;"/> </a> </td> <td class="areasLink"> <a onclick="toggleOpcaoAreasRisco('excluir')"> #{messages['areasrisco.janela.excluir']} </a> </td> </tr> <tr> <td class="areasHint"> #{messages['areasrisco.janela.excluir.explicacao']} </td> </tr> <tr> <td id="excluirAreaRiscoTD" align="center" colspan="2"/> </tr> <tr height="10"/> <tr> <td rowspan="2" align="right"> <a onclick="toggleShareLinks(polyEditando, 'editar');"> <img src="images/warning.png"/> </a> </td> <td class="areasLink"> <a onclick="toggleShareLinks(polyEditando, 'editar');"> #{messages['areasrisco.janela.alertar']} </a> </td> </tr> <tr> <td class="areasHint"> #{messages['areasrisco.janela.alertar.explicacao']} </td> </tr> <tr> <td id="editarShareLinksTD" align="center" colspan="2"/> </tr> <tr height="10"/> <tr> <td rowspan="2" align="right"> <a onclick="alterarFormato();toggleOpcaoAreasRisco('editarFormato');"> <img src="images/resize.png"/> </a> </td> <td class="areasLink"> <a onclick="alterarFormato();toggleOpcaoAreasRisco('editarFormato');"> #{messages['areasrisco.janela.limites']} </a> </td> </tr> <tr> <td class="areasHint"> #{messages['areasrisco.janela.limites.explicacao']} </td> </tr> <tr> <td id="editarFormatoAreaRiscoTD" align="center" colspan="2"/> </tr> <tr height="10"/> </table>
</HtmlPanel>
</div> </body> </html>
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"> <script type="text/javascript"> /* <![CDATA[ */ function mostraHintNoMapa(msg, latlng, negrito){ var hint = document.getElementById("divHint"); map.getDiv().appendChild(hint); //n�o sair da tela var numCaracteres = msg.length; var widthEx = numCaracteres <= 15 ? numCaracteres : 15; //20 � uma largura m�xima (em caracteres) var panel = document.getElementById("panelHint"); panel.style.textAlign = 'center'; if(negrito) panel.style.fontWeight = 'bold'; else panel.style.fontWeight = 'normal'; panel.style.width = widthEx + "ex"; //a largura em "em" (relativo ao tamanho da fonte) var widthPixel = panel.offsetWidth; //a largura em pixels var padding = 20; var ajusteVertical = 50; var mapBounds = map.getBounds(); var mapPixel = latlngToPixel(mapBounds.getNorthEast()); var mapEast = mapPixel.x; var mapNorth = mapPixel.y; var hintPixel = latlngToPixel(latlng); var hintWest = hintPixel.x; var hintEast = hintWest + widthPixel; var hintNorth = hintPixel.y; var pos = map.getProjection().fromLatLngToPoint(latlng); var sobra = hintEast + padding - mapEast; if(sobra > 0){ pos.x -= sobra; if(hintNorth - ajusteVertical > mapNorth + padding) pos.y -= ajusteVertical; else pos.y += ajusteVertical; } //posicaoHint = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(pos.x, pos.y-20)); //posicaoHint.apply(hint); document.getElementById("msgHint").innerHTML = msg; document.getElementById("divHint").style.visibility = "visible"; } function removeHint(){ document.getElementById("divHint").style.visibility = "hidden"; document.getElementById("msgHint").innerHTML = ""; } /* ]]> */ </script> <style> #divHint{ position: absolute; text-align: left; padding: 1em; z-index: 100; -moz-opacity:0.85; filter: alpha(opacity=85); color: #000000; font-family: helvetica,verdana,sans; font-size: 14px; visibility: hidden; } </style> <div id="divHint">
<HtmlPanel id="panelHint" rendered="true" style="border-color:black; border-width: 1px; background-color:#FFFF99" transient="false">
<span id="msgHint"> </span>
</HtmlPanel>
</div> </html>
<!-- <ui:include src="scripts/rotasegurajs.xhtml" /> -->
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript"><!-- /* <![CDATA[ */ var tutorEstaAtivado; var jaMostrouAjudaPesquisa = false; var jaMostrouInteracaoMapa = false; var jaMostrouTipoMapa = false; var jaMostrouAjudaPesquisaCrime = false; var jaMostrouFiltro = false; var jaMostrouAjudaEstatisticasAV=false; var jaMostrouAjudaHotSpot = false; var jaMostrouAjudaAreaAlerta = false; function verificarRegras(situacao, ultimaAcao){ var numAleatorio = geraNumero(1,100); if(situacao['carregou_app']){ if(numAleatorio>50 && !jaMostrouAjudaEstatisticasAV){ mostraBalaoEstatisticasAreaVisivel(); situacao['carregou_app'] = false; return; }else if(!jaMostrouAjudaAreaAlerta){ mostraBalaoAreaAlerta(); situacao['carregou_app'] = false; return; } } if(situacao['filtrou'] && situacao['massa_dados_filtrados']>=100){ if(!jaMostrouAjudaHotSpot){ mostraBalaoHotSpot(); situacao['filtrou']=false; return; } } if(situacao['qtd_move_map']>=5 && ultimaAcao=="move_map"){ if(!jaMostrouAjudaPesquisa && numAleatorio> 60){ mostraBalaoPesquisaEndereco(); return; } } if(situacao['qtd_move_map']>=13 && ultimaAcao=="move_map"){ if(!jaMostrouInteracaoMapa && numAleatorio> 60){ mostrarBalaoInteracaoMapa() return; } } if(situacao['qtd_mostrar_dados']>=2 && ultimaAcao=="mostrar_dados"){ if(!jaMostrouAjudaPesquisaCrime && numAleatorio> 70){ mostraBalaoPesquisaCrime(); return; } } if(situacao['zoom']>=15 && map.getCurrentMapType() != G_SATELLITE_MAP && (ultimaAcao=="move_map" || ultimaAcao=="zoom_map")){ if(!jaMostrouTipoMapa && numAleatorio> 40){ mostrarBalaoTipoMapa(); return; } } } function mostraBalaoPesquisaEndereco(){ criaBalaoSetaCima("#{messages['tutor.ajuda.pesquisa.endereco']}",conteudoSemAjudaRelacionada(),"divBalaoTutorDireita"); mostrarBalao('190px','76px',"divBalaoTutorDireita"); jaMostrouAjudaPesquisa = true; } function mostraBalaoFiltro(){ criaBalaoSetaCima("#{messages['tutor.ajuda.filtro']}",conteudoSemAjudaRelacionada(),"divBalaoTutorEsquerda"); mostrarBalao('128px','148px',"divBalaoTutorEsquerda"); jaMostrouFiltro = true; } function mostraBalaoEstatisticasAreaVisivel(){ criaBalaoSetaBaixo("#{messages['tuto.ajuda.area.visivel1']} #{filtroForm.quantidadeCrimes} #{messages['tuto.ajuda.area.visivel2']} "+(qtd_roubos+qtd_furtos+qtd_outros+qtd_denuncias)+" #{messages['tuto.ajuda.area.visivel3']} <a style='cursor:pointer; color:blue; text-decoration: none; background-color: transparent' onclick='fecharBalao();mostraBalaoFiltro();'>#{messages['tutor.ajuda.filtro.nome']}</a> #{messages['tuto.ajuda.area.visivel4']} "+document.getElementById("dataInicial").value+" #{messages['estatisticas.area.visivel.data.periodo']} "+document.getElementById("dataFinal").value+".",conteudoSemAjudaRelacionada(),"divBalaoTutorEsquerda"); mostrarBalao('72px','260px',"divBalaoTutorEsquerda"); jaMostrouAjudaEstatisticasAV = true; } function mostraBalaoPesquisaCrime(){ criaBalaoSetaCima("#{messages['tutor.ajuda.pesquisa.crime']}",conteudoSemAjudaRelacionada(),"divBalaoTutorDireita"); mostrarBalao('370px','76px',"divBalaoTutorDireita"); jaMostrouAjudaPesquisaCrime = true; } function mostraBalaoHotSpot(){ criaBalaoSetaCima("#{messages['tutor.ajuda.hots.spots']}",conteudoSemAjudaRelacionada(),"divBalaoTutorEsquerda"); mostrarBalao('178px','148px',"divBalaoTutorEsquerda"); jaMostrouAjudaHotSpot = true; } function mostraBalaoAreaAlerta(){ criaBalaoSetaCima("#{messages['tutor.ajuda.area.alerta']}",conteudoSemAjudaRelacionada(),"divBalaoTutorEsquerda"); mostrarBalao('178px','118px',"divBalaoTutorEsquerda"); jaMostrouAjudaAreaAlerta = true; } function mostrarBalaoInteracaoMapa(){ criaBalaoSetaCima("#{messages['tutor.ajuda.interacao.mapa']}",conteudoSemAjudaRelacionada(),"divBalaoTutorEsquerda"); mostrarBalao('32px','152px', "divBalaoTutorEsquerda"); jaMostrouInteracaoMapa = true; } function mostrarBalaoTipoMapa(){ criaBalaoSetaCima("#{messages['tutor.ajuda.tipo.mapa']}",conteudoSemAjudaRelacionada(),"divBalaoTutorDireita"); mostrarBalao('10px','104px', "divBalaoTutorDireita"); jaMostrouTipoMapa = true; } function alertarTutorDeAcaoDoUsuario(situacao, ultimaAcao){ if(tutorEstaAtivado){ verificarRegras(situacao, ultimaAcao); } } function geraNumero(inferior,superior){ var numPossibilidades = superior - inferior; var aleat = Math.random() * numPossibilidades; aleat = Math.floor(aleat); return parseInt(inferior) + aleat; } function desabilitaTutor(time){ var flag = false; if(tutorEstaAtivado){ tutorEstaAtivado = false; flag = true; } setTimeout(function(){ if(flag) tutorEstaAtivado = true; },time); } function conteudoSemAjudaRelacionada(){ var html = '<br/><table style="width:100%; cursor:pointer;padding : 0px;font-family:Arial, sans-serif;font-size: 11px;">'; html += ' <tr>'; html += ' <td><hr/>'; html += conteudoNaoReceberAjudaTutor(); html += ' </td>'; html += ' </tr>'; html += '</table>'; return html; } function conteudoNaoReceberAjudaTutor(){ var html = '<input type="checkbox" id="checkDesabilitaTutor" name="checkDesabilitaTutor"/>#{messages["tutor.nao.ser.ajudado"]}'; return html; } function fecharBalao(){ document.getElementById("divBalaoTutorEsquerda").style.visibility = "hidden"; document.getElementById("divBalaoTutorDireita").style.visibility = "hidden"; if(document.getElementById("checkDesabilitaTutor")!=null && document.getElementById("checkDesabilitaTutor").checked) desabilitaTutorSemTempo(); } function desabilitaTutorSemTempo(){ document.getElementById('formDesabilitaTutor:btDesabilitaTutor').click(); tutorEstaAtivado = false; if(usuarioEstaLogado()) mostrarMensagem("#{messages['tutor.desabilita.ajuda.logado']}", "300px"); else mostrarMensagem("#{messages['tutor.desabilita.ajuda']}", "260px"); } /* ]]> */ --></script> </html>
<script type="text/javascript" src="./scripts/balao.js"/> <title>
#{messages['webapp.welcome']}
| WikiCrimes.org</title> <meta http-equiv="Cache-Control" content="no-store"/> <meta http-equiv="Pragma" content="no-cache"/> <meta http-equiv="Expires" content="0"/> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> <meta name="verify-v1" content="4agWH6CfFZSFhfqytQWYq61DjxDYM7VHkVAH1yyW2Ts="/> <link rel="shortcut icon" href="./images/favicon.ico" type="image/x-icon"/> <link rel="stylesheet" type="text/css" href="./styles/wikicrimes.css" title="default"/> <script type="text/javascript" src="./scripts/anylink.js"> </script> <link rel="stylesheet" href="./styles/modal-message.css" type="text/css"/> <script type="text/javascript" src="./scripts/modal-message.js"/> <script type="text/javascript" src="./scripts/detectBrowser.js"/> <script type="text/javascript"> function mostrarModalParceria(){ openModal('./parceiros.html', 600, 500,'#{messages['colaboracao.titulo']}'); } function mostrarFaleConosco() { openModal('./faleConosco.html', 600, 500,'#{messages['webapp.faleConosco']}'); } function showAjuda(url, w, h) { w += 10; h += 40; wleft = (screen.width - w) / 2; wtop = (screen.height - h) / 2; url = url; var win = window.open(url, '', 'width=' + w + ', height=' + h + ', ' + 'left=' + wleft + ', top=' + wtop + ', ' + 'location=no, menubar=no, titlebar=no,' + 'status=no, toolbar=no, scrollbars=no, resizable=no'); // Just in case width and height are ignored win.resizeTo(w, h); // Just in case left and top are ignored win.moveTo(wleft, wtop); win.focus(); return false; } </script>
</head> <body onload="loadMapa();"> <div style="width:989px; height:auto; margin-left:auto; margin-right:auto;position:relative"> <TABLE style="font-size: 12px; font-family: sans-serif;" margin="0" BORDER="0" cellpadding="1" cellspacing="1" width="100%"> <TR> <TD height="58px" valign="top" colspan="2" style="background: url(#{messages['imagem.topo']}) no-repeat left;">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="./scripts/modal2.js"/> <link rel="stylesheet" href="./styles/modal2.css" type="text/css"/> <!--<link rel="stylesheet" href="./styles/modal-message.css" type="text/css" />--> <!--<script type="text/javascript" src="./scripts/modal-message.js"></script>--> <link rel="alternate" type="application/rss+xml" title="#{messages['rss.titulo']}" href="#{request.contextPath}/rss"/> </head> <body>
<HtmlPanelGroup colspan="-2147483648" displayValueOnly="false" id="painelPrincipaLoginLogout" rendered="true" transient="false">
<h1 style="font-size: 10px; position: absolute; top: 35px; left: 3px; color: gray; font-family: sans-serif;">#{messages['wikicrimes.slogan']}</h1>
<table align="right" cellpadding="1" cellspacing="0" border="0"> <tr> <td width="40px"/> <td>
<HtmlOutputLink disabled="false" id="j_id44" onclick="mostrarPainelLogin('./login.html');" rendered="true" transient="false" value="#">
<HtmlOutputText escape="true" id="j_id45" rendered="true" transient="false" value="Login"/>
</HtmlOutputLink>
|</td> <td>
<HtmlOutputLink disabled="false" id="j_id47" onclick="openModal('./registrarUsuario.html', 600, 350,'Join WikiCrimes.org', this);return false;" rendered="true" transient="false" value="#">
<HtmlOutputText escape="true" id="j_id48" rendered="true" transient="false" value="Join"/>
</HtmlOutputLink>
|</td> <td>
<HtmlOutputLink disabled="false" id="j_id50" onclick="openModal('./ajudaEng.html', 650, 400,'Help', this);" rendered="true" transient="false" value="#">
<HtmlOutputText escape="true" id="j_id51" rendered="true" title="WikiCrimes.org Help" transient="false" value="Help"/>
</HtmlOutputLink>
</td> <td> <a href="#{request.contextPath}/rss" styleClass="estiloImagem">
<HtmlGraphicImage id="j_id53" ismap="false" rendered="true" style="border: 0;" transient="false" url="/images/feed-icon-14x14.png" value="/images/feed-icon-14x14.png"/>
</a> </td> </tr> </table>
<HtmlForm enctype="application/x-www-form-urlencoded" id="formReRenderRegistroCrimes" prependId="true" rendered="true" submitted="false" transient="false">
<HtmlAjaxCommandButton ajaxSingle="false" bypassUpdates="false" disabled="false" id="btRegistroCrimeSubmit" ignoreDupResponses="false" immediate="false" limitToList="false" rendered="true" requestDelay="-2147483648" size="-2147483648" style="display: none" timeout="-2147483648" transient="false"/>
</HtmlForm>
<HtmlForm enctype="application/x-www-form-urlencoded" id="formReRenderRegistroDenuncia" prependId="true" rendered="true" submitted="false" transient="false">
<HtmlAjaxCommandButton ajaxSingle="false" bypassUpdates="false" disabled="false" id="btRegistroDenunciaSubmit" ignoreDupResponses="false" immediate="false" limitToList="false" rendered="true" requestDelay="-2147483648" size="-2147483648" style="display: none" timeout="-2147483648" transient="false"/>
</HtmlForm>
<HtmlForm enctype="application/x-www-form-urlencoded" id="formDesabilitaTutor" prependId="true" rendered="true" submitted="false" transient="false">
<HtmlAjaxCommandButton action="#{filtroForm.desabilitaTutor}" actionExpression="#{filtroForm.desabilitaTutor}" ajaxSingle="false" bypassUpdates="false" disabled="false" id="btDesabilitaTutor" ignoreDupResponses="false" immediate="false" limitToList="false" rendered="true" requestDelay="-2147483648" size="-2147483648" style="display: none" timeout="-2147483648" transient="false"/>
</HtmlForm>
<HtmlForm enctype="application/x-www-form-urlencoded" id="formReRenderLogin" prependId="true" rendered="true" submitted="false" transient="false">
<HtmlAjaxCommandButton ajaxSingle="false" bypassUpdates="false" disabled="false" id="btLoginSubmit" ignoreDupResponses="false" immediate="false" limitToList="false" rendered="true" requestDelay="-2147483648" size="-2147483648" style="display: none" timeout="-2147483648" transient="false"/>
</HtmlForm>
<HtmlForm enctype="application/x-www-form-urlencoded" id="formDownloadMobile" prependId="true" rendered="true" submitted="false" transient="false">
<HtmlCommandButton action="#{usuarioForm.mostraPaginaInstrucoes}" actionExpression="#{usuarioForm.mostraPaginaInstrucoes}" disabled="false" id="btInstrucoesMobile" immediate="false" readonly="false" rendered="true" style="display: none" transient="false"/>
</HtmlForm>
<script> /* <![CDATA[ */ //div modal function loginCasoPrecise(tipo, msg){ var precisaLogin = #{usuario == null}; if(precisaLogin) mostrarPainelLogin('./login.html?mensagemLogin=' + msg + '&'+ 'tipoRegistro='+tipo); return precisaLogin; } function onLogout(){ //*********************** AREAS RISCO INICIO **************************** //pra esconder as areas de risco do usuario q fez logoff e //forcar de carregar areas novamente qd o proximo usuario q fizer login limparMinhasAreas(); //*********************** AREAS RISCO FIM **************************** } function usuarioEstaLogado(){ if(#{usuario != null}) return true; else return false; } function registrarArea1(){ if(#{usuario != null}){ selecionarComando(map, 'area'); //document.getElementById("divExplicaMarcarArea").style.visibility = "visible"; estaRegistrandoArea = true; startShape(); } else{ mostrarPainelLogin('./login.html?mensagemLogin=#{messages["usuario.informacao.area"]}&tipoRegistro=3'); } } function gerarEmbedded(){ if(#{usuario != null}){ openModal('./geradorEmbedded.html', 900, 510,'#{messages["mapaEmbedded.estado.mapa"]}'); }else{ mostrarPainelLogin('./login.html'); } } /* var comandoControleMao = new ComandoMao(map); var comandoControleMaoSelecionado = new ComandoMaoSelecionado(map); var comandoControleMarcadorDeArea = new ComandoMarcadorDeArea(map); var comandoControleMarcadorDeAreaSelecionado = new ComandoMarcadorDeAreaSelecionado(map); var comandoControleEmbed = new ComandoEmbed(map); var comandoControleEmbedSelecionado = new ComandoEmbedSelecionado(); var comandoControleFiltro = new ComandoFiltro(map); var comandoControleFiltroSelecionado = new ComandoFiltroSelecionado(map); var comandoControleKernel = new ComandoKernel(map); var comandoControleKernelSelecionado = new ComandoKernelSelecionado(map); */ var kernelEnabled = false; function selecionarComando(mapa, comando, off){ //alert('comando: ' + comando + ', off:' + off); //mapa.removeControl(comandoControleMao); //mapa.removeControl(comandoControleMaoSelecionado); //mapa.removeControl(comandoControleMarcadorDeArea); //mapa.removeControl(comandoControleMarcadorDeAreaSelecionado); //mapa.removeControl(comandoControleEmbed); //mapa.removeControl(comandoControleEmbedSelecionado); //mapa.removeControl(comandoControleFiltro); //mapa.removeControl(comandoControleFiltroSelecionado); //mapa.removeControl(comandoControleKernel); //mapa.removeControl(comandoControleKernelSelecionado); mapa.controls[google.maps.ControlPosition.TOP_LEFT].clear(); if(comando=='filtro'){ var controlsLeft = document.createElement("div"); var controlsRight = document.createElement("div"); controlsRight.style.marginLeft = "2px"; //mapa.addControl(comandoControleMarcadorDeArea); //mapa.addControl(comandoControleMao); //mapa.addControl(comandoControleKernel); //mapa.addControl(comandoControleFiltroSelecionado); var comandoMao = ComandoMao(mapa); var comandoFiltro = ComandoFiltroSelecionado(mapa); var comandoMarcadorArea = ComandoMarcadorDeArea(mapa); controlsLeft.appendChild(comandoFiltro); if(!kernelEnabled) { var kernel = ComandoKernel(mapa); } else { var kernelSel = ComandoKernelSelecionado(mapa); } if(#{usuario.perfil.nome == 'CERTIFICADOR'}||#{usuario.perfil.nome == 'ADMINISTRADOR'}){ if(#{usuario.entidadeCertificadora.idEntidadeCertificadora != 12}){ //mapa.addControl(comandoControleEmbed); } } mapa.controls[google.maps.ControlPosition.TOP_LEFT].push(controlsLeft); } if(comando=='kernel'){ var controlsLeft = document.createElement("div"); var controlsRight = document.createElement("div"); controlsRight.style.marginLeft = "2px"; var comandoMao = ComandoMao(mapa); var comandoFiltro = ComandoFiltro(mapa); var comandoMarcadorArea = ComandoMarcadorDeArea(mapa); if(off){ var kernel = ComandoKernel(mapa); }else{ var kernelSel = ComandoKernelSelecionado(mapa); } if(#{usuario.perfil.nome == 'CERTIFICADOR'}||#{usuario.perfil.nome == 'ADMINISTRADOR'}){ if(#{usuario.entidadeCertificadora.idEntidadeCertificadora != 12}){ //mapa.addControl(comandoControleEmbed); } } controlsLeft.appendChild(comandoFiltro); mapa.controls[google.maps.ControlPosition.TOP_LEFT].push(controlsLeft); } if(comando=='mao'){ var controlsLeft = document.createElement("div"); var controlsRight = document.createElement("div"); controlsRight.style.marginLeft = "2px"; var comandoMaoSelecionado = ComandoMaoSelecionado(mapa); var comandoFiltro = ComandoFiltro(mapa); var comandoMarcadorArea = ComandoMarcadorDeArea(mapa); controlsLeft.appendChild(comandoFiltro); if(!kernelEnabled) { var kernel = ComandoKernel(mapa); } else { var kernelSel = ComandoKernelSelecionado(mapa); } if(#{usuario.perfil.nome == 'CERTIFICADOR'}||#{usuario.perfil.nome == 'ADMINISTRADOR'}){ if(#{usuario.entidadeCertificadora.idEntidadeCertificadora != 12}){ //mapa.addControl(comandoControleEmbed); } } mapa.controls[google.maps.ControlPosition.TOP_LEFT].push(controlsLeft); } if(comando == 'area'){ document.getElementById("divTelaFiltro").style.visibility = "hidden"; mapa.addControl(comandoControleMarcadorDeAreaSelecionado); mapa.addControl(comandoControleMao); //mapa.addControl(comandoControleKernel); mapa.addControl(comandoControleFiltro); if(#{usuario.perfil.nome == 'CERTIFICADOR'}||#{usuario.perfil.nome == 'ADMINISTRADOR'}){ if(#{usuario.entidadeCertificadora.idEntidadeCertificadora != 12}){ //mapa.addControl(comandoControleEmbed); } } } if(comando == 'nenhum'){ document.getElementById("divTelaKML").style.visibility = "hidden"; document.getElementById("divTelaFiltro").style.visibility = "hidden"; var controlsLeft = document.createElement("div"); var controlsRight = document.createElement("div"); controlsRight.style.marginLeft = "2px"; var comandoMao = ComandoMao(mapa); var comandoFiltro = ComandoFiltro(mapa); var comandoMarcadorArea = ComandoMarcadorDeArea(mapa); if(off){ var kernel = ComandoKernel(mapa); }else{ var kernelSel = ComandoKernelSelecionado(mapa); } if(#{usuario.perfil.nome == 'CERTIFICADOR'}||#{usuario.perfil.nome == 'ADMINISTRADOR'}){ if(#{usuario.entidadeCertificadora.idEntidadeCertificadora != 12}){ //mapa.addControl(comandoControleEmbed); } } controlsLeft.appendChild(comandoFiltro); mapa.controls[google.maps.ControlPosition.TOP_LEFT].push(controlsLeft); } if(comando == 'embed'){ document.getElementById("divTelaKML").style.visibility = "hidden"; document.getElementById("divTelaFiltro").style.visibility = "hidden"; var controlsLeft = document.createElement("div"); var controlsRight = document.createElement("div"); controlsRight.style.marginLeft = "2px"; var comandoMao = ComandoMao(mapa); var comandoFiltro = ComandoFiltro(mapa); var comandoMarcadorArea = ComandoMarcadorDeArea(mapa); if(off){ var kernel = ComandoKernel(mapa); }else{ var kernelSel = ComandoKernelSelecionado(mapa); } if(#{usuario.perfil.nome == 'CERTIFICADOR'}||#{usuario.perfil.nome == 'ADMINISTRADOR'}){ if(#{usuario.entidadeCertificadora.idEntidadeCertificadora != 12}){ //mapa.addControl(comandoControleEmbed); } } controlsLeft.appendChild(comandoFiltro); mapa.controls[google.maps.ControlPosition.TOP_LEFT].push(controlsLeft); } } try{ selecionarComando(map, 'mao'); }catch(e){}; /* ]]> */ </script>
</HtmlPanelGroup>
</body> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<HtmlForm enctype="application/x-www-form-urlencoded" id="j_id59" prependId="true" rendered="true" submitted="false" transient="false">
<table border="0" cellspacing="0" cellpadding="0" style="position: absolute; right: 0; margin-top: 30px;"> <tr> <td> <div style="margin-right: 2px; float: left">
<HtmlCommandLink action="#{localeForm.MudaLocale}" actionExpression="#{localeForm.MudaLocale}" disabled="false" id="j_id61" immediate="true" rendered="true" transient="false">
<UIParameter id="j_id62" name="languageCode" rendered="true" transient="false" value="pt"/>
<HtmlGraphicImage id="j_id63" ismap="false" rendered="true" transient="false" url="/images/flags/Brazil.gif" value="/images/flags/Brazil.gif"/>
</HtmlCommandLink>
</div> <div style="margin-right: 2px;margin-left:2px; float: left">
<HtmlCommandLink action="#{localeForm.MudaLocale}" actionExpression="#{localeForm.MudaLocale}" disabled="false" id="j_id65" immediate="true" rendered="true" transient="false">
<UIParameter id="j_id66" name="languageCode" rendered="true" transient="false" value="en"/>
<HtmlGraphicImage id="j_id67" ismap="false" rendered="true" transient="false" url="/images/flags/USA.png" value="/images/flags/USA.png"/>
</HtmlCommandLink>
</div> <div style="margin-right: 2px;margin-left:2px; float: left">
<HtmlCommandLink action="#{localeForm.MudaLocale}" actionExpression="#{localeForm.MudaLocale}" disabled="false" id="j_id69" immediate="true" rendered="true" transient="false">
<UIParameter id="j_id70" name="languageCode" rendered="true" transient="false" value="fr"/>
<HtmlGraphicImage id="j_id71" ismap="false" rendered="true" transient="false" url="/images/flags/French.PNG" value="/images/flags/French.PNG"/>
</HtmlCommandLink>
</div> <div style="margin-right: 2px;margin-left:2px; float: left">
<HtmlCommandLink action="#{localeForm.MudaLocale}" actionExpression="#{localeForm.MudaLocale}" disabled="false" id="j_id73" immediate="true" rendered="true" transient="false">
<UIParameter id="j_id74" name="languageCode" rendered="true" transient="false" value="es"/>
<HtmlGraphicImage id="j_id75" ismap="false" rendered="true" transient="false" url="/images/flags/Spain.gif" value="/images/flags/Spain.gif"/>
</HtmlCommandLink>
</div> <div style="margin-left:2px; float: left">
<HtmlCommandLink action="#{localeForm.MudaLocale}" actionExpression="#{localeForm.MudaLocale}" disabled="false" id="j_id77" immediate="true" rendered="true" transient="false">
<UIParameter id="j_id78" name="languageCode" rendered="true" transient="false" value="it"/>
<HtmlGraphicImage id="j_id79" ismap="false" rendered="true" transient="false" url="/images/flags/Italy.png" value="/images/flags/Italy.png"/>
</HtmlCommandLink>
</div> </td> </tr> </table>
</HtmlForm>
</html>
</TD> </TR> <TR id="trBotoes"> <TD height="20px" colspan="2">
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> <link rel="stylesheet" href="./styles/modal-message.css" type="text/css"/> <script type="text/javascript" src="./scripts/modal-message.js"/> <meta http-equiv="Cache-Control" content="no-store"/> <meta http-equiv="Pragma" content="no-cache"/> <meta http-equiv="Expires" content="0"/> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> </head> <body> <!-- Caso o usu�rio esteja logado -->
<AjaxForm ajaxSingle="false" ajaxSubmit="false" bypassUpdates="false" id="pesquisaGenerica" ignoreDupResponses="false" limitToList="false" prependId="true" rendered="true" requestDelay="-2147483648" submitted="false" timeout="-2147483648" transient="false">
<HtmlAjaxCommandButton action="#{filtroForm.pesquisarGenericamente}" actionExpression="#{filtroForm.pesquisarGenericamente}" ajaxSingle="false" bypassUpdates="false" disabled="false" id="btnBuscaGenerica" ignoreDupResponses="false" immediate="false" limitToList="false" rendered="true" requestDelay="-2147483648" size="-2147483648" style="display: none" timeout="-2147483648" transient="false" value=""/>
<HtmlPanelGrid border="-2147483648" cellpadding="0" cellspacing="0" columns="2" displayValueOnly="false" id="j_id85" rendered="true" style="margin-top:5px;" transient="false" width="100%">
<HtmlPanelGrid border="-2147483648" cellpadding="0" cellspacing="0" columns="3" displayValueOnly="false" id="j_id86" rendered="true" transient="false">
<HtmlPanelGrid border="-2147483648" columns="1" displayValueOnly="false" id="j_id87" rendered="true" transient="false" width="130px">
<HtmlOutputLink disabled="false" id="j_id88" onclick="mostrarPainelLogin('./login.html?mensagemLogin=You must login to register crimes.&tipoRegistro=1', this)" rendered="true" transient="false" value="#">
<HtmlOutputText escape="true" id="j_id89" rendered="true" style="font-size:13px" transient="false" value="Report a Crime"/>
</HtmlOutputLink>
</HtmlPanelGrid>
<HtmlPanelGrid border="-2147483648" columns="1" displayValueOnly="false" id="j_id90" rendered="true" transient="false">
<HtmlOutputLink disabled="false" id="j_id91" onclick="mostrarPainelLogin('./login.html?mensagemLogin=You must login to register denounces.&tipoRegistro=2', this)" rendered="true" transient="false" value="#">
<HtmlOutputText escape="true" id="j_id92" rendered="true" style="font-size:13px;" transient="false" value="Report a Denounce"/>
</HtmlOutputLink>
</HtmlPanelGrid>
<HtmlPanelGrid border="-2147483648" columns="1" displayValueOnly="false" id="j_id93" rendered="true" style="padding-left: 50px;" transient="false">
<HtmlOutputText escape="true" id="j_id94" rendered="true" style="font-size:12px; text-align: right; margin-top: 2px; color: gray;" transient="false" value="284031 Total of informed crimes"/>
</HtmlPanelGrid>
</HtmlPanelGrid>
<HtmlPanelGrid border="-2147483648" cellpadding="0" cellspacing="0" columns="3" displayValueOnly="false" id="j_id95" rendered="true" style="margin-bottom: 5px;" transient="false">
<HtmlPanelGrid border="-2147483648" cellpadding="0" cellspacing="0" columns="1" displayValueOnly="false" id="j_id96" rendered="true" transient="false">
<HtmlSelectOneMenu disabled="false" displayValueOnly="false" escape="true" id="tipoPesquisa" immediate="false" localValueSet="false" readonly="false" rendered="true" required="false" transient="false" valid="true">
<UISelectItem id="j_id97" itemDisabled="false" itemEscaped="false" itemLabel="Search..." itemValue="0" rendered="true" transient="false"/>
<UISelectItem id="j_id98" itemDisabled="false" itemEscaped="false" itemLabel="Address" itemValue="1" rendered="true" transient="false"/>
<UISelectItem id="j_id99" itemDisabled="false" itemEscaped="false" itemLabel="Crime" itemValue="2" rendered="true" transient="false"/>
</HtmlSelectOneMenu>
</HtmlPanelGrid>
<HtmlPanelGrid border="-2147483648" cellpadding="0" cellspacing="0" columns="1" displayValueOnly="false" id="j_id100" rendered="true" transient="false">
<HtmlInputText disabled="false" disabledOnClientSide="false" displayValueOnly="false" id="pesquisa" immediate="false" localValueSet="false" maxlength="-2147483648" onkeypress="return submitEnter(event);" readonly="false" rendered="true" required="false" size="30" transient="false" valid="true"/>
</HtmlPanelGrid>
<HtmlPanelGrid border="-2147483648" cellpadding="0" cellspacing="0" columns="1" displayValueOnly="false" id="j_id101" rendered="true" transient="false">
<HtmlCommandButton disabled="false" id="btnPesquisa" immediate="false" onclick="submeteFormularioPesquisaGenerica();return false;" readonly="false" rendered="true" styleClass="button" transient="false" value="search"/>
</HtmlPanelGrid>
</HtmlPanelGrid>
</HtmlPanelGrid>
<script> /* <![CDATA[ */ function submeteFormularioPesquisaGenerica(){ defaultFilter = true; //************* MAPA DE KERNEL inicio************************ //ajeita o problema de ficar tela vermelha no Chrome apagaMapaKernel(); //*************** MAPA DE KERNEL fim************************* var opcao = document.getElementById("pesquisaGenerica:tipoPesquisa").value; if( opcao=='0' || opcao=='1'){ showLocal(); } if(opcao=='2'){ jaMostrouAjudaPesquisaCrime = true; document.getElementById("pesquisaGenerica:btnBuscaGenerica").click(); } return false; } function submitEnter(e){ var unicode=e.keyCode? e.keyCode : e.charCode if (unicode == 13) { submeteFormularioPesquisaGenerica(); return false; } else return true; } function mostraDivPesquisaGenerica(){ //if(net_browser==11){ //document.getElementById("divPesquisaGenerica").style.top = '154px'; //document.getElementById("divPesquisaGenerica").style.left='57.12%'; //} document.getElementById("divPesquisaGenerica").style.visibility = 'visible'; } function fechaDivPesquisaGenerica(){ document.getElementById("divPesquisaGenerica").style.visibility = 'hidden'; } var regCrime; function mostraDivTelaEscolhaRegistroTipoCrime(){ mostrarCarregandoPequeno(); //document.getElementById("formReRenderRegistroCrimes:btRegistroCrimeSubmit").click(); marcarCrimeMapaLocalizacao(true); setPodeRegistrar(false, 0); fechaDivTelaEscolhaRegistroTipoDenuncia(); } function fechaDivTelaEscolhaRegistroTipoCrime(){ document.getElementById("divTelaEscolhaRegistroTipoCrime").style.visibility = 'hidden'; } function mostraDivTelaEscolhaRegistroTipoDenuncia(){ mostrarCarregandoPequeno(); marcarCrimeMapaLocalizacao(false); //document.getElementById("formReRenderRegistroDenuncia:btRegistroDenunciaSubmit").click(); setPodeRegistrar(false, 0); fechaDivTelaEscolhaRegistroTipoCrime(); } function fechaDivTelaEscolhaRegistroTipoDenuncia(){ document.getElementById("divTelaEscolhaRegistroTipoDenuncia").style.visibility = 'hidden'; } function fechaDivPesquisaGenericaChamandoMostraDados(chave, lat, lng){ idconf = null; mostrarCrimeMapa(chave, lat, lng); fechaDivPesquisaGenerica(); } function limparPesquisaGenerica(){ fechaDivPesquisaGenerica(); document.getElementById("pesquisa").value = ""; } /* ]]> */ </script>
</AjaxForm>
</body> </html>
</TD> </TR> <TR> <TD colspan="2">
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> <style> td{ padding:0px; } #loading { position: absolute; top: 200px; left: 25%; text-align: center; padding: 2em; margin-left: auto; margin-right: auto; z-index: 99; opacity: .85; -moz-opacity:0.85; filter: alpha(opacity=85); color:#0000CD; font-family:helvetica,verdana,sans; font-size:12px; } #loadingPequeno { position: absolute; top: 288px; left: 38%; text-align: center; padding: 0.6em; margin-left: auto; margin-right: auto; z-index: 98; opacity: .99; -moz-opacity:0.99; filter: alpha(opacity=99); font-family:helvetica,verdana,sans; font-size:14px; visibility: hidden; background-color: white; border: 2px solid #4674b9; } #divPesquisaGenerica { position: absolute; right:206px; z-index: 99; opacity: .95; -moz-opacity:0.95; filter: alpha(opacity=95); color:#000000; font-family:helvetica,verdana,sans; font-size:12px; visibility:hidden; background-color:#ffffff; border:1px solid #333333; } #divTelaEscolhaRegistroTipoCrime { position: absolute; top: 180px; left: 34%; text-align: center; margin-left: auto; margin-right: auto; z-index: 99; opacity: .95; -moz-opacity:0.95; filter: alpha(opacity=95); color:#000000; font-family:helvetica,verdana,sans; font-size:12px; visibility:hidden; background-color:#ffffff; } #divTelaEscolhaRegistroTipoDenuncia { position: absolute; top: 220px; left: 34%; text-align: center; margin-left: auto; margin-right: auto; z-index: 99; opacity: .95; -moz-opacity:0.95; filter: alpha(opacity=95); color:#000000; font-family:helvetica,verdana,sans; font-size:12px; visibility:hidden; background-color:#ffffff; } #divAvisosNoMapa { position: absolute; top: 220px; left: 30%; text-align: center; margin-left: auto; margin-right: auto; z-index: 99; opacity: .95; -moz-opacity:0.95; filter: alpha(opacity=95); color:#000000; font-family:helvetica,verdana,sans; font-size:12px; visibility:hidden; background-color:#ffffff; } #loadingKernelMap { position: absolute; top: 35%; left: 30%; text-align: center; padding: 2em; margin-left: auto; margin-right: auto; z-index: 99; opacity: .85; -moz-opacity:0.85; filter: alpha(opacity=85); color:#0000CD; font-family:helvetica,verdana,sans; font-size:14px; visibility:hidden; } #divHintComandoMapa { position: absolute; text-align: left; padding: 1em; z-index: 99; -moz-opacity:0.85; filter: alpha(opacity=85); color:#000000; font-family:helvetica,verdana,sans; font-size:14px; visibility:hidden; } #cursor1 { background-color:#ffffff; border:1px solid black; font-family:helvetica,verdana,sans; font-size:10px; font-weight:bold; left:0px; padding:5px; position:absolute; top:0px; white-space:nowrap; filter: alpha(opacity=85); opacity: .85; -moz-opacity:0.85; } #comment { position: absolute; top: 574px; left: 4px; text-align: left; z-index: 99; opacity: .55; -moz-opacity:0.55; filter: alpha(opacity=55); background-color:#3A5FCD; font-family:helvetica,verdana,sans; font-size:12px; overflow: auto; height: 100px; width: 638px; display: none; } .moldura{ background-color:yellow; border:1px solid #333333; padding:15px; font-size:10px; text-align:center; width:16px; padding:0px; } #divBalaoTutorEsquerda { position: absolute; visibility:visible; top:50%; left:100px; padding: 15px 0 0 0; width:200px; font-family:Arial, sans-serif; font-size: 11px; z-index: 100; } #divBalaoTutorDireita { position: absolute; visibility:visible; top:50%; right:150px; padding: 15px 0 0 0; width:200px; font-family:Arial, sans-serif; font-size: 11px; z-index: 99; } </style> </head> <div id="comment"> </div> <script><!-- /* <![CDATA[ */ var contNumRender = 0; var contNumRenderRegistroDenuncia = 0; var contNumRenderRegistroCrime = 0; var tipoCrimeSel = 0; var tipoVitimaSel = 0; function setaTipoVitimaTipoCrime(tipoCrime, tipoVitima){ document.getElementById('divErroRegistroCrime').innerHTML=""; tipoCrimeSel = tipoCrime; tipoVitimaSel = tipoVitima } function marcarCrimeMapa(eCrime){ setPodeRegistrar(true,tipoCrimeSel,tipoVitimaSel); } function mostraSubtipoCrime(tipoCrime){ document.getElementById('divErroRegistroCrime').innerHTML=""; tipoCrimeSel = 0; tipoVitimaSel = 0; var htmlRegistroCrime = ""; if(tipoCrime==1){ habilitaBtn('btnMarcarMapa'); htmlRegistroCrime += "<hr/><table align='left'"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td colspan='2'> #{messages['escolha.opcao.melhor.adequa.registro']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td width='12px'> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(4,1);'></td><td align='left'>#{messages['menu.roubo.roubopessoa']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(4,2);'></td><td align='left'>#{messages['menu.roubo.roubopropriedade']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(1,1);'></td><td align='left'>#{messages['menu.roubo.tentativaroubopessoa']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(1,2);'></td><td align='left'>#{messages['menu.roubo.tentativaroubopropriedade']}</td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += "</table>"; document.getElementById('divSubTipoCrime').innerHTML = htmlRegistroCrime; document.getElementById('divLembreSe').innerHTML = "#{messages['crime.roubo.descricao']}"; }else if(tipoCrime==2){ habilitaBtn('btnMarcarMapa'); htmlRegistroCrime += "<hr/><table align='left'"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td colspan='2'> #{messages['escolha.opcao.melhor.adequa.registro']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td width='12px'> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(3,1);'></td><td align='left'>#{messages['menu.furto.furtopessoa']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(3,2);'></td><td align='left'>#{messages['menu.furto.furtopropriedade']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(2,1);'></td><td align='left'>#{messages['menu.furto.tentativafurtopessoa']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(2,2);'></td><td align='left'>#{messages['menu.furto.tentativafurtopropriedade']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += "</table>"; document.getElementById('divSubTipoCrime').innerHTML = htmlRegistroCrime; document.getElementById('divLembreSe').innerHTML = "#{messages['crime.furto.descricao']}"; }else if(tipoCrime==3){ habilitaBtn('btnMarcarMapa'); htmlRegistroCrime += "<hr/><table align='left'"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td colspan='2'> #{messages['escolha.opcao.melhor.adequa.registro']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td width='12px'> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(5,3);'></td><td align='left'>#{messages['menu.violencia.rixasbrigas']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(5,4);'></td><td align='left'>#{messages['menu.violencia.violenciadomestica']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(5,5);'></td><td align='left'>#{messages['menu.violencia.abusoautoridade']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(5,6);'></td><td align='left'>#{messages['menu.violencia.homicidio']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(5,7);'></td><td align='left'>#{messages['menu.violencia.tentativahomicidio']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(5,8);'></td><td align='left'>#{messages['menu.violencia.latrocinio']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += " <tr>"; htmlRegistroCrime += " <td> <input type='radio' name='group1' onclick='setaTipoVitimaTipoCrime(5,9);'></td><td align='left'>#{messages['menu.violencia.atentadoaopudor']} </td>"; htmlRegistroCrime += " </tr>"; htmlRegistroCrime += "</table>"; document.getElementById('divSubTipoCrime').innerHTML = htmlRegistroCrime; document.getElementById('divLembreSe').innerHTML = ""; }else{ desabilitaBtn('btnMarcarMapa'); document.getElementById('divSubTipoCrime').innerHTML = ""; document.getElementById('divLembreSe').innerHTML = ""; } } function habilitaBtn(btn){ document.getElementById(btn).style.visibility = 'visible'; } function desabilitaBtn(btn){ document.getElementById(btn).style.visibility = 'hidden'; } function marcarCrimeMapaLocalizacao(eCrime){ regCrime = eCrime; document.getElementById('loadingPequeno').style.display = "none"; tipoCrimeSel = eCrime; jQuery('#trBotoes').fadeOut('slow'); jQuery('#trEstatistica').fadeOut('slow'); jQuery('#map').fadeOut('slow',function(){ jQuery('#localizacaoRegistro').fadeIn('slow',function(){ loadMapaLocalizacao(); }); }); } var mapaRegistro; var crimeRegistro; var zoomRegistro; var mapaLocalizacaoX; var mapaLocalizacaoY; var localizacao; var geocoder; var address; function loadMapaLocalizacao() { mapaRegistro = new google.maps.Map(document.getElementById("mapaRegistro"),{ center: map.getCenter(), zoom: map.getZoom(), mapTypeId: google.maps.MapTypeId.ROADMAP, panControl: false, streetViewControl: false, scrollwheel: false }); mapaLocalizacaoX = map.getCenter().lat(); mapaLocalizacaoY = map.getCenter().lng(); localizacao = map.getCenter(); var rua = document.getElementById('rua').value; var ruaTrim = replaceAll(rua,' ',''); if(ruaTrim == null || ruaTrim == 'undefined' || ruaTrim == ''){ jQuery('#btnConfirmar').css('background-color', 'gray'); /*jQuery('#btnConfirmar').css('border','none');*/ jQuery('#btnConfirmar').attr('disabled','true'); } getAddress(new google.maps.LatLng(mapaLocalizacaoX,mapaLocalizacaoY), function(){ showLocalMapaLocalizacao(); }); } function getAddress(latlng) { if(latlng != null) { geocoder = new google.maps.Geocoder(); geocoder.geocode({'location': latlng}, function(results, status){ if (status == google.maps.GeocoderStatus.OK) { } else { alert("Geocode was not successful for the following reason: " + status); } showAddress(results[0]); }); } } function showAddress(result) { result.address_components.each(function(el){ el.types.each(function(type){ if(type == 'country'){ document.getElementById('pais').value = el.short_name; } if(type == 'administrative_area_level_1'){ document.getElementById('estado').value = el.short_name; } if(type == 'locality'){ document.getElementById('cidade').value = el.short_name; } }); }); } function apagaMapaKernelMapaLocalizacao(){ //mapa.removeTPhoto(photo); } function mostrarMapaQuatro(valor){ if(valor.length == 0){ jQuery('#btnConfirmar').css('background-color', 'gray'); jQuery('#btnConfirmar').attr('disabled','true'); } } function showLocalMapaLocalizacao() { var pais = document.getElementById("pais").value; var estado = document.getElementById("estado").value; var cidade = document.getElementById("cidade").value; var bairro = document.getElementById("bairro").value; var rua = document.getElementById("rua").value; var numero = document.getElementById("numero").value; var endereco = pais + " " + estado + " " + cidade + " " + bairro + " " + rua + " " + numero; if (!geocoder) { geocoder = new google.maps.Geocoder(); } geocoder.geocode({'address': endereco}, function(results, status){ if (status == google.maps.GeocoderStatus.OK) { if (results[0].types == 'country,political') { zoom = 4; } else if (results[0].types == 'administrative_area_level_1,political') { zoom = 6; } else if (results[0].types == 'locality,political') { zoom = 10; } else if (results[0].types == 'administrative_area_level_2,political') { zoom = 12; } else if (results[0].types == 'point_of_interest,establishment') { zoom = 18; } else { zoom = 17; } mapaRegistro.setZoom(zoom); mapaRegistro.setCenter(results[0].geometry.location); plotaEnderecoMapaLocalizacao(results[0]); } else { alert("Geocode was not successful for the following reason: " + status); } }); } function replaceAll(string, token, newtoken) { while (string.indexOf(token) != -1) { string = string.replace(token, newtoken); } return string; } function plotaEnderecoMapaLocalizacao(place) { //informando tutor que o usu�rio j� usou a busca por endere�o jaMostrouAjudaPesquisa = true; point = place.geometry.location; var html=place.formatted_address + " <br/> " + "<b>#{messages['menu.mensagem.escolher.numero']}</b>"; if (place.types == 'country,political') { zoom = 4; } else if (place.types == 'administrative_area_level_1,political') { zoom = 6; } else if (place.types == 'locality,political') { zoom = 10; } else if (place.types == 'administrative_area_level_2,political') { zoom = 12; } else if (place.types == 'point_of_interest,establishment') { zoom = 18; } else { zoom = 17; } mapaLocalizacaoX = place.geometry.location.lat(); mapaLocalizacaoY = place.geometry.location.lng(); zoomRegistro = zoom; localizacao = point; preparaRequisicaoMudandoDataMapaLocalizacao(point, zoom); var rua = document.getElementById('rua').value; var ruaTrim = replaceAll(rua,' ',''); if(ruaTrim != null && ruaTrim != 'undefined' && ruaTrim != ''){ jQuery('#btnConfirmar').css('background-color', '#6DA6E2'); jQuery('#btnConfirmar').removeAttr('disabled'); //mapaRegistro.openInfoWindowHtml(point,html); crimeRegistro = marcadorRegistro(); google.maps.event.addListener(mapaRegistro, "dragstart", function() { //mapaRegistro.closeInfoWindow(); }); google.maps.event.addListener(crimeRegistro, "dragend", function() { mapaLocalizacaoX = crimeRegistro.getPosition().lat(); mapaLocalizacaoY = crimeRegistro.getPosition().lng(); var pos = place.geometry.location; localizacao=crimeRegistro.getPosition(); point = pos; zoomRegistro = mapaRegistro.getZoom(); }); atualizaMapaLocalizacao(); crimeRegistro.setMap(mapaRegistro); }else{ jQuery('#btnConfirmar').css('background-color', 'gray'); jQuery('#btnConfirmar').attr('disabled','true'); } function preparaRequisicaoMudandoDataMapaLocalizacao(point, zoom){ var temp=podeCarregarCrimes; podeCarregarCrimes=false; if(point != null){ mapaRegistro.setCenter(point); mapaRegistro.setZoom(zoom); } ignoraData="false"; filtrou=false; tempDataMaisAntiga= new Date(); atualizaMapaLocalizacao(); } function atualizaMapaLocalizacao(){ if(mapaRegistro){ if(crimeRegistro) crimeRegistro.setMap(null); }else { setTimeout(atualizaMapa,500); } } } function marcarMapaPrincipal(latLng){ var infoTT = document.createElement("div"); map.setOptions({ draggable:false, center: localizacao, zoom: zoomLimiteInfMarcadores }); podeCarregarCrimes=true; desativaMapaKernel(); podeCarregarCrimes=false; crime2 = marcadorRegistro(); crime2.setPosition(latLng); //tive que comentar o markermanager pois dava erro quando utilizava o modo hibrido, adiciona com overlay e depois removo crime2.setMap(map); if (regCrime == false) crime2.registrarRelato(6, 0); else crime2.registrarCrime(idTipoCrime, idSubTipoCrime); crime2.setDraggable(false); atualiza=true; atualizaGrupos=true; setPodeRegistrar(false, 0); // Esconde toolTip do marcador temporário. infoTT.style.visibility="hidden"; } function confirmar(){ var pais = document.getElementById("pais").value = ''; var estado = document.getElementById("estado").value = ''; var cidade = document.getElementById("cidade").value = ''; var bairro = document.getElementById("bairro").value = ''; var rua = document.getElementById("rua").value = ''; var numero = document.getElementById("numero").value = ''; jQuery('#localizacaoRegistro').fadeOut('slow',function(){ jQuery('#trBotoes').fadeIn('slow'); jQuery('#trEstatistica').fadeIn('slow'); jQuery('#map').fadeIn('slow',function(){ marcarCrimeMapa(true); }); }); } function cancelar(){ var pais = document.getElementById("pais").value = ''; var estado = document.getElementById("estado").value = ''; var cidade = document.getElementById("cidade").value = ''; var bairro = document.getElementById("bairro").value = ''; var rua = document.getElementById("rua").value = ''; var numero = document.getElementById("numero").value = ''; jQuery('#localizacaoRegistro').fadeOut('slow',function(){ jQuery('#trBotoes').fadeIn('slow'); jQuery('#trEstatistica').fadeIn('slow'); jQuery('#map').fadeIn('slow'); }); } function marcadorRegistro(){ var marker = createMarker(point, tipoCrime); marker.setDraggable(true); return marker; } /* ]]> */ --></script> <div id="divTelaEscolhaRegistroTipoCrime">
<HtmlPanel header="Select the type of crime" id="j_id108" rendered="true" transient="false">
<HtmlPanelGrid border="-2147483648" columns="3" displayValueOnly="false" id="panelRegistroCrime" rendered="true" style="text-align: left" transient="false" width="400px">
<HtmlPanelGroup colspan="3" displayValueOnly="false" id="divErroRegistroCrime" rendered="true" style="with:100%;color:red;" transient="false"/>
<HtmlPanelGroup colspan="3" displayValueOnly="false" id="j_id109" rendered="true" transient="false">
<HtmlOutputText escape="true" id="j_id110" rendered="true" transient="false" value="What type of crime you want to register?"/>
</HtmlPanelGroup>
<HtmlPanelGroup colspan="2" displayValueOnly="false" id="j_id111" rendered="true" transient="false">
<select style="font-size: 12px" id="comboTipoCrime" onchange="mostraSubtipoCrime(this.value);"> <option value=""> #{messages['usuario.Selecione']} </option> <option value="1"> #{messages['tipocrime.roubo']} </option> <option value="2"> #{messages['tipocrime.furto']}</option> <option value="3"> #{messages['tipocrime.violencia']} </option> </select>
</HtmlPanelGroup>
<HtmlPanelGroup colspan="-2147483648" displayValueOnly="false" id="divLembreSe" rendered="true" style="with:100%;color:blue;" transient="false"/>
<HtmlPanelGroup colspan="3" displayValueOnly="false" id="divSubTipoCrime" rendered="true" style="with:100%" transient="false"/>
<HtmlPanelGroup colspan="3" displayValueOnly="false" id="j_id113" rendered="true" style="width: 100%" transient="false">
<br/> <input name="btnMarcarMapa" id="btnMarcarMapa" style="font-size: 11px; visibility : hidden;" class="button" type="button" value="#{messages['marcar.no.mapa']}" onclick="marcarCrimeMapaLocalizacao(true);/*marcarCrimeMapa(true);desabilitaBtn('btnMarcarMapa');*/"/> <input style="font-size: 11px;" class="button" type="button" value="#{messages['faleconosco.cancelar']}" onclick="fechaDivTelaEscolhaRegistroTipoCrime();desabilitaBtn('btnMarcarMapa');"/> <script> try{escondeCarregandoPequeno()}catch(e){}; contNumRenderRegistroCrime++; if(contNumRenderRegistroCrime > 1) document.getElementById("divTelaEscolhaRegistroTipoCrime").style.visibility = 'visible'; </script>
</HtmlPanelGroup>
</HtmlPanelGrid>
</HtmlPanel>
</div> <div id="divBalaoTutorEsquerda"/> <div id="divBalaoTutorDireita"/> <div id="divTelaEscolhaRegistroTipoDenuncia">
<HtmlPanel header="Select the type of denounce" id="panelRegistroDenuncia" rendered="true" transient="false">
<HtmlPanelGrid border="-2147483648" columns="1" displayValueOnly="false" id="j_id116" rendered="true" style="text-align: left" transient="false" width="400px">
<HtmlPanelGroup colspan="-2147483648" displayValueOnly="false" id="divErroRegistroDenuncia" rendered="true" style="with:100%;color:red;" transient="false"/>
<HtmlPanelGroup colspan="-2147483648" displayValueOnly="false" id="j_id117" rendered="true" style="width: 100%" transient="false">
<HtmlOutputText escape="true" id="j_id118" rendered="true" transient="false" value="What type of denounce you want to register?"/>
</HtmlPanelGroup>
<HtmlPanelGroup colspan="-2147483648" displayValueOnly="false" id="j_id119" rendered="true" style="width: 100%" transient="false">
<table cellpadding="0" cellspacing="0"> <tr> <td> <select style="font-size: 12px" id="comboTipoRelato" onchange="setaTipoVitimaTipoCrime(6,this.value);"> <option value=""> #{messages['usuario.Selecione']} </option> <option value="4"> #{messages['menu.relato.alcohol.abuse']}</option> <option value="6"> #{messages['menu.relato.child.abuse']}</option> <option value="1"> #{messages['menu.relato.areasperigosas']} </option> <option value="2"> #{messages['menu.relato.drogas']}</option> <option value="3"> #{messages['menu.relato.shebeen.location']}</option> <option value="5"> #{messages['menu.relato.woman.abuse']}</option> </select> </td> </tr> </table>
</HtmlPanelGroup>
<HtmlPanelGroup colspan="-2147483648" displayValueOnly="false" id="j_id121" rendered="true" style="width: 100%" transient="false">
<br/> <input style="font-size: 11px;" class="button" type="button" value="#{messages['marcar.no.mapa']}" onclick="marcarCrimeMapaLocalizacao(false);/*marcarCrimeMapa(false);*/"/> <input style="font-size: 11px;" class="button" type="button" value="#{messages['faleconosco.cancelar']}" onclick="fechaDivTelaEscolhaRegistroTipoDenuncia();"/> <script> try{escondeCarregandoPequeno()}catch(e){}; contNumRenderRegistroDenuncia++; if(contNumRenderRegistroDenuncia > 1) document.getElementById("divTelaEscolhaRegistroTipoDenuncia").style.visibility = 'visible'; </script>
</HtmlPanelGroup>
</HtmlPanelGrid>
</HtmlPanel>
</div> <div id="divAvisosNoMapa" style="width:300px; text-align:center">
<HtmlPanel header="System Message" id="panelAvisosNoMapa" rendered="true" style="text-align: center; width:100%;" transient="false">
<table align="center" style="width:100%; cursor:pointer;padding : 0px;font-family:Arial, sans-serif;font-size: 11px;"> <tr> <td>
<HtmlPanelGroup colspan="-2147483648" displayValueOnly="false" id="divInternaAvisosNoMapa" rendered="true" style="text-align:center" transient="false"/>
</td> </tr> <tr> <td>
<HtmlPanelGroup colspan="-2147483648" displayValueOnly="false" id="divfecharAvisosNoMapa" rendered="true" style="text-align:center" transient="false">
<input align="center" style="font-size: 11px;" class="button" type="button" value="OK" onclick="esconderMensagem();"/>
</HtmlPanelGroup>
</td> </tr> </table>
</HtmlPanel>
</div> <div id="divPesquisaGenerica">
<HtmlPanelGrid border="-2147483648" columns="1" displayValueOnly="false" id="painelMostraDadosPesqGen" rendered="true" transient="false">
<HtmlPanelGrid border="-2147483648" cellpadding="0" cellspacing="1" columns="2" displayValueOnly="false" id="j_id129" rendered="true" style="width:330px" transient="false">
<HtmlPanelGroup colspan="2" displayValueOnly="false" id="j_id130" rendered="true" style="text-align:center" transient="false">
<HtmlOutputText escape="true" id="j_id131" rendered="true" transient="false" value="Your query did not bring any results."/>
</HtmlPanelGroup>
</HtmlPanelGrid>
<HtmlPanelGroup colspan="2" displayValueOnly="false" id="j_id132" rendered="true" transient="false">
<script> contNumRender++; if(contNumRender > 1) mostraDivPesquisaGenerica(); </script> <a onclick="limparPesquisaGenerica();" style="cursor:pointer;color:blue"><u>
<HtmlOutputText escape="true" id="j_id134" rendered="true" transient="false" value="clear Query "/>
</u></a>
</HtmlPanelGroup>
</HtmlPanelGrid>
</div> <div id="loading">
<HtmlPanel id="j_id137" rendered="true" style="width: 390px; border-color:blue; border-width: 2px; background-color:#3A5FCD" transient="false">
<p> <span>
<HtmlOutputText escape="true" id="j_id139" rendered="true" style=" margin:5px; font-size:16px; color:white; font-weight:bold" transient="false" value="Be an active member in your community! "/>
<br/>
<HtmlOutputText escape="true" id="j_id141" rendered="true" style="margin:5px; font-size:16px; color:white; font-weight:bold" transient="false" value="Share crime information "/>
<br/>
<HtmlOutputText escape="true" id="j_id143" rendered="true" style="margin:5px; font-size:16px; color:white; font-weight:bold" transient="false" value="and help alert others."/>
<br/><br/> </span> <span id="loadingMessage" style="font-size:14px; color:white">
<HtmlOutputText escape="true" id="j_id145" rendered="true" transient="false" value="Loading map. Please, wait..."/>
</span> </p> <p align="right">
<HtmlOutputLink disabled="false" id="j_id147" onclick="window.stop();mostrarPainelLogin('./login.html');" rendered="true" transient="false" value="#">
<HtmlOutputText escape="true" id="j_id148" rendered="true" style="margin:5px; font-size:14px; font-weight:bold; color:#87CEFA; background-color:#3A5FCD; float:right; " transient="false" value="Login"/>
</HtmlOutputLink>
<br/> </p>
</HtmlPanel>
</div> <div id="loadingPequeno"> <img src="./images/loading.gif"/> </div> <div id="loadingKernelMap">
<HtmlPanel id="j_id151" rendered="true" style="width: 390px; border-color:blue; border-width: 2px; background-color:#3A5FCD" transient="false">
<p> <br/><br/><br/> <span id="loadingMessageKernelMap" style="font-size:14px; color:white">
<HtmlOutputText escape="true" id="j_id153" rendered="true" transient="false" value="The Kernel Map is being loaded. Please wait..."/>
</span> <br/><br/> </p>
</HtmlPanel>
</div> <div id="divHintComandoMapa">
<HtmlPanel id="j_id156" rendered="true" style="width: 160px;border-color:black; border-width: 1px; background-color:#FFFF99" transient="false">
<span id="msgHintComandoMapa"> </span>
</HtmlPanel>
</div> <div id="cursor1" onMouseOver="escondeTooltip(1)" style="display: none;"> <span id="loadingMessage">crimes</span> </div> <div style="min-height: 386px;"> <div onclick="fechaDivPesquisaGenerica();" id="map" style="width: 100%; height: 386px;"/> <div id="localizacaoRegistro" style="width: 982px; height: 386px; display: none;"> <!-- <rich:panel id="panelRegistro" style="width:100%; height: 100%; text-align: center;" header="#{messages['message.wikicrimes.registro.localizacao']}">--> <table style="width: 100%;"> <tr> <td><p class="toptitulo" align="center">
<HtmlOutputText escape="true" id="j_id159" rendered="true" title="Enter the location of the crime" transient="false" value="Enter the location of the crime"/>
</p><hr style="border: 0; border-top: 2px #A9A9A9 dotted;"/></td> </tr> <tr> <td> <table> <tr> <td> <div style="text-align: left; margin-top: 15px; margin-left: 15px;"> <div> <div style="left: 0; margin-left: 0px;">
<HtmlOutputText escape="true" id="j_id161" rendered="true" style="font-size:13px;" transient="false" value="Country"/>
</div>
<HtmlInputText disabled="false" disabledOnClientSide="false" displayValueOnly="false" id="pais" immediate="false" localValueSet="false" maxlength="-2147483648" onblur="showLocalMapaLocalizacao();" readonly="false" rendered="true" required="false" size="30" transient="false" valid="true"/>
</div> <br/> <div> <div>
<HtmlOutputText escape="true" id="j_id164" rendered="true" style="font-size:13px" transient="false" value="State"/>
</div>
<HtmlInputText disabled="false" disabledOnClientSide="false" displayValueOnly="false" id="estado" immediate="false" localValueSet="false" maxlength="-2147483648" onblur="showLocalMapaLocalizacao();" readonly="false" rendered="true" required="false" size="30" transient="false" valid="true"/>
</div> <br/> <div> <div>
<HtmlOutputText escape="true" id="j_id167" rendered="true" style="font-size:13px" transient="false" value="City"/>
</div>
<HtmlInputText disabled="false" disabledOnClientSide="false" displayValueOnly="false" id="cidade" immediate="false" localValueSet="false" maxlength="-2147483648" onblur="showLocalMapaLocalizacao();" readonly="false" rendered="true" required="false" size="30" transient="false" valid="true"/>
</div> <br/> <div> <div>
<HtmlOutputText escape="true" id="j_id170" rendered="true" style="font-size:13px" transient="false" value="District"/>
</div>
<HtmlInputText disabled="false" disabledOnClientSide="false" displayValueOnly="false" id="bairro" immediate="false" localValueSet="false" maxlength="-2147483648" onblur="showLocalMapaLocalizacao();" readonly="false" rendered="true" required="false" size="30" transient="false" valid="true"/>
</div> <br/> <div> <div>
<HtmlOutputText escape="true" id="j_id173" rendered="true" style="font-size:13px" transient="false" value="Street"/>
</div>
<HtmlInputText disabled="false" disabledOnClientSide="false" displayValueOnly="false" id="rua" immediate="false" localValueSet="false" maxlength="-2147483648" onblur="showLocalMapaLocalizacao();" onkeyup="mostrarMapaQuatro(this.value)" readonly="false" rendered="true" required="false" size="30" transient="false" valid="true"/>
</div> <br/> <div> <div>
<HtmlOutputText escape="true" id="j_id176" rendered="true" style="font-size:13px" transient="false" value="Number"/>
</div>
<HtmlInputText disabled="false" disabledOnClientSide="false" displayValueOnly="false" id="numero" immediate="false" localValueSet="false" maxlength="-2147483648" onkeyup="showLocalMapaLocalizacao();" readonly="false" rendered="true" required="false" size="5" style="margin-right:44px;" transient="false" valid="true"/>
<!-- <t:commandButton id="btnBuscarMapa" forceId="true" styleClass="button" onclick="showLocalMapaLocalizacao();" value="#{messages['botoes.btn.buscarMapaLado']}"></t:commandButton>--> </div> <br/> <div>
<HtmlCommandButton disabled="true" id="btnConfirmar" immediate="false" onclick="confirmar();" readonly="false" rendered="true" style="margin-right:8px; background-color: gray; border: none;" styleClass="button" transient="false" value="Confirm"/>
<HtmlCommandButton disabled="false" id="btnCancelar" immediate="false" onclick="cancelar();" readonly="false" rendered="true" styleClass="button" transient="false" value="Cancel"/>
</div> </div> </td> <td style="width: 90%;"> <div id="mapaRegistro" style="margin-top:10px; margin-left: 5%; height: 340px;margin-right: 15px;"> </div> </td> </tr> </table> </td> </tr> <tr> <td><hr style="border: 0; border-top: 2px #A9A9A9 dotted;"/></td> </tr> </table> <!-- </rich:panel> --> </div> </div> </html>
</TD> </TR> <TR id="trEstatistica"> <TD colspan="2" style="padding: 0px;"> <div style="font-family: sans-serif;margin:0px;width:100%;height:80px;background-color:#C6E2FF">
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<HtmlPanelGrid border="-2147483648" columns="2" displayValueOnly="false" id="painelPrincipalEstatisticas" rendered="true" style=" font-family: sans-serif;" transient="false" width="100%">
<HtmlPanelGrid border="-2147483648" columns="2" displayValueOnly="false" id="j_id183" rendered="true" transient="false">
<HtmlPanelGroup colspan="2" displayValueOnly="false" id="j_id184" rendered="true" style="text-align: left; vertical-align: top" transient="false">
<b>
<HtmlOutputText escape="true" id="j_id186" rendered="true" style="font-size: 13px" transient="false" value="Information of the viewport:"/>
</b>
</HtmlPanelGroup>
<HtmlPanelGroup colspan="2" displayValueOnly="false" id="j_id188" rendered="true" transient="false">
<HtmlOutputText escape="true" id="j_id189" rendered="true" style="font-size: 12px" transient="false" value="Total of occurrences:"/>
<HtmlPanelGroup colspan="-2147483648" displayValueOnly="false" id="divQtdeCrimesFiltrados" rendered="true" style="font-size: 12px; text-align: left;" transient="false"/>
</HtmlPanelGroup>
<HtmlPanelGroup colspan="2" displayValueOnly="false" id="j_id190" rendered="true" transient="false">
<HtmlOutputText escape="true" id="j_id191" rendered="true" style="font-size: 12px" transient="false" value="Filter selected:"/>
<HtmlPanelGroup colspan="-2147483648" displayValueOnly="false" id="divFiltrosAplicados" rendered="true" style="font-size: 12px; text-align: left;" transient="false"/>
</HtmlPanelGroup>
<HtmlPanelGroup colspan="2" displayValueOnly="false" id="j_id192" rendered="true" transient="false">
<HtmlOutputLink disabled="false" id="j_id193" rendered="true" style="background-color: transparent; color:blue;" target="_blank" transient="false" value="estatistica.html">
<HtmlOutputText escape="true" id="j_id194" rendered="true" transient="false" value="More stats!"/>
</HtmlOutputLink>
</HtmlPanelGroup>
</HtmlPanelGrid>
<HtmlPanelGrid border="-2147483648" columns="2" displayValueOnly="false" id="j_id195" rendered="true" transient="false" width="100%">
<HtmlPanelGroup colspan="-2147483648" displayValueOnly="false" id="graficoEstatisticasAV" rendered="true" style="position: relative;" transient="false"/>
<HtmlPanelGroup colspan="-2147483648" displayValueOnly="false" id="graficoRazoesAV" rendered="true" style="position: relative;" transient="false"/>
</HtmlPanelGrid>
</HtmlPanelGrid>
</html>
</div> </TD> </TR> <TR> <TD align="left" colspan="2" style="padding-top: 7px;"> <div style="font-family:sans-serif; width:100%; margin-top: 25px;">
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"> <br/> <head> <meta http-equiv="Cache-Control" content="no-store"/> <meta http-equiv="Pragma" content="no-cache"/> <meta http-equiv="Expires" content="0"/> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> <link rel="shortcut icon" href="./images/favicon.ico" type="image/x-icon"/> </head> <body> <table> <tr> <td colspan="1"><p class="topcrimes">Top WikiCrimes</p></td> <td align="right"> </td> </tr> <tr> <td colspan="2"> <hr style="border: 0; border-top: 2px #A9A9A9 dotted;"/> </td> </tr> <tr> <td width="510px" height="170px" valign="top"> <p class="toptitulo">#{messages['crimes.maiscomentados']}</p>
<HtmlDataTable border="-2147483648" expandedEmpty="true" first="0" forceId="false" id="crimes1" newspaperColumns="1" preserveDataModel="false" preserveRowStates="false" preserveSort="true" rendered="true" renderedIfEmpty="true" rowIndex="-1" rows="0" sortAscending="true" sortColumnIndex="-1" sortable="false" transient="false" var="crime">
<HtmlSimpleColumn defaultSorted="false" groupBy="false" id="j_id200" rendered="true" sortable="false" transient="false">
<HtmlOutputLink disabled="false" id="j_id201" rendered="true" transient="false" value="verCrime.html">
<HtmlOutputText converter="javax.faces.convert.DateTimeConverter@3fc8842a" escape="true" id="j_id202" rendered="true" style="font-size:11px" transient="false"/>
<span> | </span>
<HtmlOutputText escape="true" id="j_id204" rendered="true" transient="false" value=""/>
<span>...</span>
<UIParameter id="j_id206" name="idCrime" rendered="true" transient="false"/>
</HtmlOutputLink>
</HtmlSimpleColumn>
</HtmlDataTable>
</td> <td width="510px" height="170px" valign="top"> <p class="toptitulo">#{messages['crimes.maisvistos']}</p>
<HtmlDataTable border="-2147483648" expandedEmpty="true" first="0" forceId="false" id="crimes2" newspaperColumns="1" preserveDataModel="false" preserveRowStates="false" preserveSort="true" rendered="true" renderedIfEmpty="true" rowIndex="-1" rows="0" sortAscending="true" sortColumnIndex="-1" sortable="false" transient="false" var="crime">
<HtmlSimpleColumn defaultSorted="false" groupBy="false" id="j_id208" rendered="true" sortable="false" transient="false">
<HtmlOutputLink disabled="false" id="j_id209" rendered="true" transient="false" value="verCrime.html">
<HtmlOutputText converter="javax.faces.convert.DateTimeConverter@700aba61" escape="true" id="j_id210" rendered="true" style="font-size:11px" transient="false"/>
<span> | </span>
<HtmlOutputText escape="true" id="j_id212" rendered="true" transient="false" value=""/>
<span>...</span>
<UIParameter id="j_id214" name="idCrime" rendered="true" transient="false"/>
</HtmlOutputLink>
</HtmlSimpleColumn>
</HtmlDataTable>
</td> </tr> </table> </body> </html>
</div> </TD> </TR> <TR> <TD align="left" colspan="2" height="20px" style="padding-top: 7px;"> <div style="overflow: auto hidden; height: 320px; width: 160px;">
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Cache-Control" content="no-store"/> <meta http-equiv="Pragma" content="no-cache"/> <meta http-equiv="Expires" content="0"/> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAg4v-Pz31X7RpxlFPsEIYsRTFxkwrVf99uCE-DFDYzwuulB3IQBTEtjQzYCPUvNslNNQOJKHac-ipqw"/> <script type="text/javascript" src="./scripts/gfeedfetcher.js"/> <script type="text/javascript" src="./scripts/gajaxticker.js"/> <script type="text/javascript" src="./scripts/util.js"/> <script type="text/javascript" src="./scripts/calendar.js"/> <script type="text/javascript" src="./scripts/calendar-setup.js"/> <script type="text/javascript" src="./scripts/googleClusterer.js"/> <script type="text/javascript" src="./scripts/lang/calendar-en.js"/> <script type="text/javascript" src="./scripts/lang/#{messages['webapp.calendar']}"/>
<style> #mascaraFiltro { position:fixed; width: 100%; height: 100%; left:0px; top:0px; z-index: 50; background-color:#000; opacity: .2; filter: alpha(opacity=20); display:none; } #brancoFiltro { width: 500px; height: 500px; position: fixed; left:0px; top:0px; background-color:#FFF; z-index: 60; display: none; } #modalFiltro { left:0px; top: 0px; display: none; position: fixed; z-index: 61; } #xfechaFiltro{ position:absolute; z-index: 120; width: 29px; height: 29px; topo_dirFiltro{ width:12px; height: 12px; background-image:url(./images/bg_modal_top_dir.png); background-repeat:no-repeat; float:left; } #corpo_esqFiltro{ width:12px; background-image:url(./images/bg_modal_esq.png); background-repeat:repeat-y; float:left; } #corpo_meioFiltro{ background-color: #FFF; float:left; } #corpo_dirFiltro{ width:12px; background-image:url(./images/bg_modal_dir.png); background-repeat:repeat-y; float:left; } #bottom_esqFiltro{ width:12px; height: 12px; background-image:url(./images/bg_modal_bottom_esq.png); background-repeat:no-repeat; float:left; } #bottom_meioFiltro{ height: 12px; background-image:url(./images/bg_modal_bottom.png); background-repeat:repeat-x; float:left; } #bottom_dirFiltro{ width:12px; height: 12px; background-image:url(./images/bg_modal_bottom_dir.png); background-repeat:no-repeat; float:left; } position: absolute; right:-5px; top: -5px; } #topo_esqFiltro{ width:12px; height: 12px; background-image:url(./images/bg_modal_top_esq.png); background-repeat:no-repeat; float:left; } #topo_meioFiltro{ height: 12px; background-image:url(./images/bg_modal_top.png); background-repeat:repeat-x; float:left; } #topo_dirFiltro{ width:12px; height: 12px; background-image:url(./images/bg_modal_top_dir.png); background-repeat:no-repeat; float:left; } #corpo_esqFiltro{ width:12px; background-image:url(./images/bg_modal_esq.png); background-repeat:repeat-y; float:left; } #corpo_meioFiltro{ background-color: #FFF; float:left; } #corpo_dirFiltro{ width:12px; background-image:url(./images/bg_modal_dir.png); background-repeat:repeat-y; float:left; } #bottom_esqFiltro{ width:12px; height: 12px; background-image:url(./images/bg_modal_bottom_esq.png); background-repeat:no-repeat; float:left; } #bottom_meioFiltro{ height: 12px; background-image:url(./images/bg_modal_bottom.png); background-repeat:repeat-x; float:left; } #bottom_dirFiltro{ width:12px; height: 12px; background-image:url(./images/bg_modal_bottom_dir.png); background-repeat:no-repeat; float:left; } #divTelaFiltro { /*position: absolute; top: -300px; left: 36%; text-align: center; margin-left: auto; margin-right: auto; z-index: 99; opacity: .95; -moz-opacity: 0.95; filter: alpha(opacity = 95); color: #000000; font-family: helvetica, verdana, sans; font-size: 12px; visibility: hidden; background-color: #ffffff;*/ } #divTelaKML { position: absolute; top: 212px; left: 36%; text-align: center; margin-left: auto; margin-right: auto; z-index: 99; opacity: .95; -moz-opacity: 0.95; filter: alpha(opacity = 95); color: #000000; font-family: helvetica, verdana, sans; font-size: 12px; visibility: hidden; background-color: #ffffff; } </style> <script type="text/javascript"> /* <![CDATA[ */ var kml var linhas; var query = location.search.substring(1); var pairs = query.split("&"); var temhash = location.hash; var idconf; var eventId; var eventType; var id; var idRelato; var i=0; var totalCrimes; var markers = []; var tempDataMaisAntiga= new Date(); var dataMaisAntiga; var tipoCrime; var tipoVitima; var tipoLocal; var dataInicial; var dataFinal; var horarioInicial; var horarioFinal; var entidadeCertificadora; var confirmadosPositivamente; var http_request = null; var submeteu=true; var isUpdatingMap=false; for (var i=0;i<pairs.length;i++) { var pos = pairs[i].indexOf("="); var argname = pairs[i].substring(0,pos).toLowerCase(); var value = pairs[i].substring(pos+1).toLowerCase(); if (argname == "idcrime") { if (temhash == "") { id = unescape(value); id = id.toUpperCase(); } } if(argname == "idrelato"){ if(temhash == ""){ idRelato = unescape(value); idRelato = idRelato.toUpperCase(); } } if (argname == "idconf") {idconf = unescape(value);} } var tpCrimes = [ {id:3, nome:'Furto'}, {id:4, nome:'Roubo'}, {id:2, nome:'Tentativa de Furto'}, {id:1, nome:'Tentativa de Roubo'}, {id:5, nome:'Violência'} ]; var tpVitimaPrimLinha = { 0:'#{messages["filtro.option.todosTipos"]}' }; var tpVitima = { 0:'#{messages["filtro.option.todosTipos"]}', 1:'#{messages["filtro.option.pessoa"]}', 2:'#{messages["filtro.option.propriedade"]}' }; var tpVitimaViolencia = { 0:'#{messages["filtro.option.todosTipos"]}', 3:'#{messages["filtro.option.rixasBrigas"]}', 4:'#{messages["filtro.option.violenciaDomestica"]}', 5:'#{messages["filtro.option.abusoAutoridade"]}', 6:'#{messages["filtro.option.homicidio"]}', 7:'#{messages["filtro.option.tentativa.homicidio"]}', 8:'#{messages["filtro.option.latrocinio"]}', 9:'#{messages["filtro.option.atentadoaopudor"]}' }; var tpLocalPrimLinha = { 0:'#{messages["filtro.option.todosLocais"]}' }; var tpLocalPessoa = { 0:'#{messages["filtro.option.todosLocais"]}', 1:'#{messages["filtro.option.viaPublica"]}', 2:'#{messages["filtro.option.dentroVeiculo"]}', 3:'#{messages["filtro.option.estabComercial"]}', 4:'#{messages["filtro.option.residencia"]}', 5:'#{messages["filtro.option.escola"]}', 6:'#{messages["filtro.option.outros"]}' }; var tpLocalResidencia = { 0:'#{messages["filtro.option.todasPropriedades"]}', 7:'#{messages["filtro.option.residencia"]}', 8:'#{messages["filtro.option.banco"]}', 17:'#{messages["tipolocalpropriedade.carga"]}', 9:'#{messages["filtro.option.farmacia"]}', 10:'#{messages["filtro.option.postoGasolina"]}', 11:'#{messages["filtro.option.loterica"]}', 12:'#{messages["filtro.option.veiculo"]}', 15:'#{messages["filtro.option.outros"]}' }; function makeTipoVitima() { dwr.util.removeAllOptions('tipoVitimaNew'); var tpCrimeId = dwr.util.getValue('tipoCrime'); if (tpCrimeId == 0) { dwr.util.addOptions('tipoVitimaNew', tpVitimaPrimLinha); } else if (tpCrimeId == 5) { dwr.util.addOptions('tipoVitimaNew', tpVitimaViolencia); } else { dwr.util.addOptions('tipoVitimaNew', tpVitima); } dwr.util.setValue('tipoVitimaNew', 0); } function makeTipoLocal() { dwr.util.removeAllOptions('tipoLocalNew'); var tpVitimaId = dwr.util.getValue('tipoVitimaNew'); if (tpVitimaId == 1) { dwr.util.addOptions('tipoLocalNew', tpLocalPessoa); $('tipoLocalNew').style.display = 'inline'; } else if (tpVitimaId == 2) { dwr.util.addOptions('tipoLocalNew', tpLocalResidencia); $('tipoLocalNew').style.display = 'inline'; } else { dwr.util.addOptions('tipoLocalNew', tpLocalPrimLinha); $('tipoLocalNew').style.display = 'inline'; } } function changeTipoVitima() { makeTipoVitima(); dwr.util.setValue('tipoVitima', 0); dwr.util.setValue('tipoVitimaNew', 0); changeTipoLocal(); } function changeTipoLocal() { makeTipoLocal(); dwr.util.setValue('tipoLocal', 0); dwr.util.setValue('tipoLocalNew', 0); } function makeCombos() { makeTipoVitima(); var tv = '#{filtroForm.tipoVitima}'; if (!isEmptyStr(tv)) dwr.util.setValue('tipoVitimaNew', tv); else dwr.util.setValue('tipoVitimaNew', 0); makeTipoLocal(); var tl = '#{filtroForm.tipoLocal}'; if (!isEmptyStr(tl)) dwr.util.setValue('tipoLocalNew', tl); else dwr.util.setValue('tipoLocalNew', 0); } function isEmptyStr(str) { if (str.match(/^\s*$/)) return true; else return false; } function getUserMapConfig(){ document.getElementById("filtroForm:zoomMapa").value=map.getZoom(); document.getElementById("filtroForm:latMapa").value=map.getCenter().lat(); document.getElementById("filtroForm:lngMapa").value=map.getCenter().lng(); limpaTela=true; filtrou=true; } function validaPeriodoData(){ var inicio = document.getElementById("dataInicial").value.split("/"); var fim = document.getElementById("dataFinal").value.split("/"); if (inicio == "" & fim == "") return true; var mesInicio = ( inicio[2] * 12 + inicio[1] ); var mesFim = ( fim[2] * 12 + fim[1] ); var diferenca = ( mesFim - mesInicio ); var periodo = diferenca + 1 if (periodo <= 0) { alert('ATENCAO: A data de inicio e maior que a data final!'); return false; } else return true; } function isNenhumCrimeEncontrado(){ if (linhas){ if (linhas.length == 1 || linhas.length==0) { return true; } } return false; } function limpaDataInicial(){ document.getElementById("dataInicial").value = ""; } function limpaDataFinal(){ document.getElementById("dataFinal").value = ""; } function limpaFiltro (){ if (map) { qtd_roubos = 0; qtd_furtos = 0; qtd_outros = 0; qtd_denuncias = 0; zeraArrayCrimes(); /*DEBUG*/console.log("limpa crimesAtuais"); crimesAtuais = {} } } function removerKML(){ map.removeOverlay(kml); } function processaKML(){ var url = document.getElementById("urlkml").value; kml = new GGeoXml(url); map.addOverlay(kml); } /* ]]> */ </script> </head> <body>
<HtmlPanelGrid border="0" cellpadding="0" cellspacing="0" columns="1" id="j_id220" rendered="true" transient="false">
<HtmlForm enctype="application/x-www-form-urlencoded" id="filtroForm" prependId="true" rendered="true" submitted="false" transient="false">
<HtmlInputHidden id="tipoLocal" immediate="false" localValueSet="false" rendered="true" required="false" transient="false" valid="true"/>
<HtmlInputHidden id="tipoVitima" immediate="false" localValueSet="false" rendered="true" required="false" transient="false" valid="true"/>
<HtmlInputHidden id="zoomMapa" immediate="false" localValueSet="false" rendered="true" required="false" transient="false" valid="true" value="4"/>
<HtmlInputHidden id="latMapa" immediate="false" localValueSet="false" rendered="true" required="false" transient="false" valid="true" value="-14.235004"/>
<HtmlInputHidden id="lngMapa" immediate="false" localValueSet="false" rendered="true" required="false" transient="false" valid="true" value="-51.925280"/>
<div id="divTelaKML"><!-- KML-->
<HtmlPanel header="Import data" id="panelKML" rendered="true" style="width:300px" transient="false">
<HtmlPanelGrid border="0" cellpadding="1" cellspacing="1" columns="1" displayValueOnly="false" id="j_id222" rendered="true" style="margin:0px;text-align:left;align:left" transient="false">
<table> <tr> <td> #{messages['kml.parte1']} <a href="http://pt.wikipedia.org/wiki/Keyhole_Markup_Language"> KML </a> #{messages['kml.parte2']} </td> </tr> </table> <br/>
<HtmlOutputText escape="true" id="j_id224" rendered="true" transient="false" value="URL:"/>
<HtmlInputText disabled="false" disabledOnClientSide="false" displayValueOnly="false" id="urlkml" immediate="false" localValueSet="false" maxlength="-2147483648" readonly="false" rendered="true" required="false" size="-2147483648" style="width:90%" transient="false" valid="true"/>
<br/>
</HtmlPanelGrid>
<HtmlPanelGrid border="0" columns="3" id="j_id226" rendered="true" transient="false">
<HtmlAjaxCommandButton ajaxSingle="false" bypassUpdates="false" disabled="false" id="btnInserir" ignoreDupResponses="false" immediate="false" limitToList="false" onclick="document.getElementById('divTelaKML').style.visibility = 'hidden'; processaKML(); selecionarComando(map, 'mao');" rendered="true" requestDelay="-2147483648" size="-2147483648" styleClass="button" timeout="-2147483648" transient="false" value="Inserir"/>
<HtmlAjaxCommandButton ajaxSingle="false" bypassUpdates="false" disabled="false" id="btnRemover" ignoreDupResponses="false" immediate="false" limitToList="false" onclick="document.getElementById('divTelaKML').style.visibility = 'hidden'; removerKML(); selecionarComando(map, 'mao');" rendered="true" requestDelay="-2147483648" size="-2147483648" styleClass="button" timeout="-2147483648" transient="false" value="Remover"/>
<HtmlAjaxCommandButton ajaxSingle="false" bypassUpdates="false" disabled="false" id="btnCancelarKML" ignoreDupResponses="false" immediate="false" limitToList="false" onclick="document.getElementById('divTelaKML').style.visibility = 'hidden';selecionarComando(map, 'mao'); return false;" rendered="true" requestDelay="-2147483648" size="-2147483648" styleClass="button" timeout="-2147483648" transient="false" value="Cancel"/>
</HtmlPanelGrid>
</HtmlPanel>
</div> <div id="mascaraFiltro" onclick="closeModalFiltro('modalFiltro')"/> <div id="brancoFiltro"/> <div id="modalFiltro"> <div id="xfechaFiltro"><a onclick="closeModalFiltro('modalFiltro')" style="cursor: pointer;"><img border="0" src="./images/bt_modal_fechar.png" width="29" height="29"/></a></div> <div id="modal_cimaFiltro"> <div id="topo_esqFiltro"/> <div id="topo_meioFiltro"/> <div id="topo_dirFiltro"/> </div> <div id="modal_corpoFiltro"> <div id="corpo_esqFiltro"/> <div id="corpo_meioFiltro"> <!-- Aqui pode ser colocado o conteúdo --> <div id="divTituloFiltro" style="left: 0;"/> <div id="divTelaFiltro" style="margin-left: 15px;"> <div><h1/></div>
<HtmlPanelGrid border="0" cellpadding="1" cellspacing="1" columns="2" displayValueOnly="false" id="j_id228" rendered="true" style="margin:0px;text-align:left;align:left" transient="false">
<HtmlPanelGroup colspan="2" displayValueOnly="false" id="j_id229" rendered="true" transient="false">
<HtmlOutputText escape="true" id="j_id230" rendered="true" transient="false" value="Type of Crime:"/>
</HtmlPanelGroup>
<HtmlSelectOneMenu disabled="false" displayValueOnly="false" escape="true" id="tipoCrime" immediate="false" localValueSet="false" onchange="changeTipoVitima();" readonly="false" rendered="true" required="false" style="font-size:10px;" transient="false" valid="true">
<UISelectItem id="j_id231" itemDisabled="false" itemEscaped="false" itemLabel="All crimes" itemValue="0" rendered="true" transient="false"/>
<UISelectItem id="j_id232" itemDisabled="false" itemEscaped="false" itemLabel="Theft" itemValue="3" rendered="true" transient="false"/>
<UISelectItem id="j_id233" itemDisabled="false" itemEscaped="false" itemLabel="Robbery" itemValue="4" rendered="true" transient="false"/>
<UISelectItem id="j_id234" itemDisabled="false" itemEscaped="false" itemLabel="Attempt Theft" itemValue="2" rendered="true" transient="false"/>
<UISelectItem id="j_id235" itemDisabled="false" itemEscaped="false" itemLabel="Attempt Robbery" itemValue="1" rendered="true" transient="false"/>
<UISelectItem id="j_id236" itemDisabled="false" itemEscaped="false" itemLabel="Others" itemValue="5" rendered="true" transient="false"/>
</HtmlSelectOneMenu>
<HtmlPanelGroup id="j_id237" rendered="true" transient="false">
<select style="font-size: 10px;" id="tipoVitimaNew" onchange="dwr.util.setValue('tipoVitima', dwr.util.getValue(this.id)); changeTipoLocal();"> </select>
</HtmlPanelGroup>
<HtmlPanelGroup colspan="2" displayValueOnly="false" id="j_id239" rendered="true" transient="false">
<HtmlOutputText escape="true" id="j_id240" rendered="true" transient="false" value="Type of place:"/>
</HtmlPanelGroup>
<HtmlPanelGroup colspan="2" displayValueOnly="false" id="j_id241" rendered="true" transient="false">
<select style="font-size: 10px;" id="tipoLocalNew" onchange="dwr.util.setValue('tipoLocal', dwr.util.getValue(this.id));"> </select>
</HtmlPanelGroup>
</HtmlPanelGrid>
<HtmlPanelGrid border="0" cellpadding="1" cellspacing="1" columns="3" displayValueOnly="false" id="j_id243" rendered="true" style="margin:0px;text-align:left;align:left" transient="false">
<HtmlPanelGroup colspan="3" displayValueOnly="false" id="j_id244" rendered="true" transient="false">
<HtmlOutputText escape="true" id="j_id245" rendered="true" style="font-size:11px;" transient="false" value="From:"/>
</HtmlPanelGroup>
<HtmlOutputText escape="true" id="j_id246" rendered="true" transient="false" value=""/>
<HtmlPanelGroup id="j_id247" rendered="true" transient="false">
<HtmlInputText converter="org.wikicrimes.web.converter.WikiCrimesSearchDataConverter@50526fbe" disabled="false" disabledOnClientSide="false" displayValueOnly="false" id="dataInicial" immediate="false" localValueSet="false" maxlength="-2147483648" onkeyup="limpaDataInicial();" readonly="false" rendered="true" required="false" size="10" style="font-size:10px;" transient="false" valid="true"/>
<HtmlGraphicImage id="triggerINI" ismap="false" rendered="true" style="display:inline; cursor:pointer;" transient="false" url="/images/btns/btnCalendar.gif" value="/images/btns/btnCalendar.gif"/>
<HtmlOutputText escape="true" id="j_id248" rendered="true" style="font-size:11px;" transient="false" value="to"/>
</HtmlPanelGroup>
<HtmlPanelGroup id="j_id249" rendered="true" transient="false">
<HtmlInputText converter="org.wikicrimes.web.converter.WikiCrimesSearchDataConverter@54264c24" disabled="false" disabledOnClientSide="false" displayValueOnly="false" id="dataFinal" immediate="false" localValueSet="false" maxlength="-2147483648" onkeyup="limpaDataFinal();" readonly="false" rendered="true" required="false" size="10" style="font-size:10px;" transient="false" valid="true" value="Fri Aug 29 11:08:21 BRT 2014"/>
<HtmlGraphicImage id="triggerDF" ismap="false" rendered="true" style="display:inline; cursor:pointer;" transient="false" url="/images/btns/btnCalendar.gif" value="/images/btns/btnCalendar.gif"/>
</HtmlPanelGroup>
</HtmlPanelGrid>
<!-- Filtros Avan�ados -->
<HtmlPanelGrid border="0" cellpadding="1" cellspacing="1" columns="3" displayValueOnly="false" id="j_id251" rendered="true" style="margin:0px;text-align:left;align:left" transient="false">
<HtmlPanelGroup colspan="3" displayValueOnly="false" id="j_id252" rendered="true" transient="false">
<HtmlOutputText escape="true" id="j_id253" rendered="true" style="font-size:11px;" transient="false" value="Time Interval:"/>
</HtmlPanelGroup>
<HtmlOutputText escape="true" id="j_id254" rendered="true" transient="false" value=""/>
<HtmlPanelGroup id="j_id255" rendered="true" transient="false">
<HtmlSelectOneMenu disabled="false" id="horarioInicial" immediate="false" localValueSet="false" readonly="false" rendered="true" required="false" style="font-size:10px;" transient="false" valid="true">
<UISelectItem id="j_id256" itemDisabled="false" itemEscaped="false" itemLabel="Any" itemValue="-1" rendered="true" transient="false"/>
<UISelectItems id="j_id257" rendered="true" transient="false"/>
</HtmlSelectOneMenu>
<HtmlOutputText escape="true" id="j_id258" rendered="true" style="font-size:11px;" transient="false" value="to"/>
</HtmlPanelGroup>
<HtmlSelectOneMenu disabled="false" id="horarioFinal" immediate="false" localValueSet="false" readonly="false" rendered="true" required="false" style="font-size:10px; " transient="false" valid="true">
<UISelectItem id="j_id259" itemDisabled="false" itemEscaped="false" itemLabel="Any" itemValue="-1" rendered="true" transient="false"/>
<UISelectItems id="j_id260" rendered="true" transient="false"/>
</HtmlSelectOneMenu>
</HtmlPanelGrid>
<HtmlPanelGrid border="0" cellpadding="1" cellspacing="1" columns="1" displayValueOnly="false" id="j_id261" rendered="true" style="margin:0px;text-align:left;align:left" transient="false">
<HtmlOutputText escape="true" id="j_id262" rendered="true" style="vertical-align: text-top; font-size:11px;" transient="false" value="Level of Credibility of the Crimes:"/>
<HtmlPanelGrid border="0" columns="3" id="j_id263" rendered="true" transient="false">
<HtmlOutputText escape="true" id="j_id264" rendered="true" style="vertical-align: text-top; font-size:11px;" transient="false" value="From: "/>
<HtmlInputNumberSlider barClass="" barStyle="" disabled="false" enableManualInput="true" handleClass="" handleSelectedClass="" id="idCredInicial" immediate="false" inputClass="" inputPosition="right" inputSize="3" inputStyle="" localValueSet="false" maxValue="100" maxlength="-2147483648" minValue="0" onchange="A4J.AJAX.Submit('_viewRoot','filtroForm',event,{'parameters':{'filtroForm:j_id265':'filtroForm:j_id265'} ,'actionUrl':'/main.html;jsessionid=F20A6AE814385A44A4C0E44E797C4B91'} )" onerror="" rendered="true" required="false" showBoundaryValues="true" showInput="false" showToolTip="true" size="-2147483648" step="1" style="" styleClass="" tipClass="" tipStyle="" transient="false" valid="true" value="50.0">
org.ajax4jsf.ajax.SUPPORTonchange
<HtmlAjaxSupport ajaxSingle="false" bypassUpdates="false" disableDefault="false" event="onchange" id="j_id265" ignoreDupResponses="false" immediate="false" limitToList="false" rendered="true" requestDelay="-2147483648" timeout="-2147483648" transient="false"/>
</HtmlInputNumberSlider>
<HtmlOutputText escape="true" id="idValorCredInic" rendered="true" transient="false" value="50.0%"/>
<HtmlOutputText escape="true" id="j_id266" rendered="true" style="vertical-align: text-top; font-size:11px;" transient="false" value="To: "/>
<HtmlInputNumberSlider barClass="" barStyle="" disabled="false" enableManualInput="true" handleClass="" handleSelectedClass="" id="idCredFinal" immediate="false" inputClass="" inputPosition="right" inputSize="3" inputStyle="" localValueSet="false" maxValue="100" maxlength="-2147483648" minValue="50.0" onchange="A4J.AJAX.Submit('_viewRoot','filtroForm',event,{'parameters':{'filtroForm:j_id267':'filtroForm:j_id267'} ,'actionUrl':'/main.html;jsessionid=F20A6AE814385A44A4C0E44E797C4B91'} )" onerror="" rendered="true" required="false" showBoundaryValues="true" showInput="false" showToolTip="true" size="-2147483648" step="1" style="" styleClass="" tipClass="" tipStyle="" transient="false" valid="true" value="100.0">
org.ajax4jsf.ajax.SUPPORTonchange
<HtmlAjaxSupport ajaxSingle="false" bypassUpdates="false" disableDefault="false" event="onchange" id="j_id267" ignoreDupResponses="false" immediate="false" limitToList="false" rendered="true" requestDelay="-2147483648" timeout="-2147483648" transient="false"/>
</HtmlInputNumberSlider>
<HtmlOutputText escape="true" id="idValorCredFinal" rendered="true" transient="false" value="100.0%"/>
</HtmlPanelGrid>
</HtmlPanelGrid>
<HtmlPanelGrid border="0" cellpadding="1" cellspacing="1" columns="1" displayValueOnly="false" id="j_id268" rendered="true" style="margin:0px;text-align:left;align:left" transient="false">
<HtmlOutputText escape="true" id="j_id269" rendered="true" style="vertical-align: text-top; font-size:11px;" transient="false" value="Select certified crimes:"/>
<HtmlPanelGrid border="0" cellpadding="0" cellspacing="0" columns="2" id="j_id270" rendered="true" transient="false">
<HtmlSelectBooleanCheckbox disabled="false" id="crimeConfirmadoPositivamente" immediate="false" localValueSet="false" readonly="false" rendered="true" required="false" selected="false" style="font-size:11px;" transient="false" valid="true"/>
<HtmlOutputText escape="true" id="j_id271" rendered="true" style="font-size:10px;" transient="false" value="positivily by users"/>
<HtmlSelectBooleanCheckbox disabled="false" id="crimeConfirmadoEntidadeCertificadora" immediate="false" localValueSet="false" onclick="habilitaListaEntidadeCertificadora();" readonly="false" rendered="true" required="false" selected="false" style="font-size:11px;" transient="false" valid="true"/>
<HtmlOutputText escape="true" id="j_id272" rendered="true" style="font-size:10px;" transient="false" value="by certifier entity"/>
</HtmlPanelGrid>
<HtmlSelectOneMenu disabled="false" id="entidadeCertificadora" immediate="false" localValueSet="false" readonly="false" rendered="true" required="false" style="font-size:10px" transient="false" valid="true">
<UISelectItems id="j_id273" rendered="true" transient="false"/>
</HtmlSelectOneMenu>
<!-- FIM Filtro por n�vel de confiabilidade --> <!-- Inser��o de um c�digo javaScript para resolu��o dos problemas com a propriedade disable do componente "selectOneMenu"--> <script type="text/javascript"> var isEntidadeCertificadoraSelecionada = document.getElementById("filtroForm:crimeConfirmadoEntidadeCertificadora").checked; if(isEntidadeCertificadoraSelecionada == false) { document.getElementById("filtroForm:entidadeCertificadora").disabled = true; document.getElementById("filtroForm:entidadeCertificadora").itemValue = ""; } </script> <!-- update vazio somente para gravar na sessao os parametros do mapa (lat,lng,zoom) -->
</HtmlPanelGrid>
<HtmlPanelGrid border="0" columns="2" id="j_id275" rendered="true" transient="false">
<HtmlAjaxCommandButton action="#{filtroForm.update}" actionExpression="#{filtroForm.update}" ajaxSingle="false" bypassUpdates="false" disabled="false" id="btnAtualizar" ignoreDupResponses="false" immediate="false" limitToList="false" onclick="esconderFiltro();selecionarComando(map, 'mao');getUserMapConfig();setaSubmeteuFiltro();atualizaMapa();" rendered="true" requestDelay="-2147483648" size="-2147483648" styleClass="button" timeout="-2147483648" transient="false" value="Visualize"/>
<HtmlAjaxCommandButton ajaxSingle="false" bypassUpdates="false" disabled="false" id="btnCancelar" ignoreDupResponses="false" immediate="false" limitToList="false" onclick="esconderFiltro();selecionarComando(map, 'mao');//comentado pq esse era o limpar filtro. limpaUrl();limpaFiltro(); return false;" rendered="true" requestDelay="-2147483648" size="-2147483648" styleClass="button" timeout="-2147483648" transient="false" value="Cancel"/>
</HtmlPanelGrid>
</div> <!-- Aqui pode ser colocado o conteúdo --> </div> <div id="corpo_dirFiltro"/> </div> <div id="modal_bottomFiltro"> <div id="bottom_esqFiltro"/> <div id="bottom_meioFiltro"/> <div id="bottom_dirFiltro"/> </div> </div> <!-- Fim da Pesquisa --> <table border="0" style="margin-left:0; position: absolute; left: 0;"> <tr> <td> <table style="margin-top: 10px; height: 352px; width: 500px;"> <tr> <td colspan="2" style=""><p class="toptitulo">Videos Wikicrimes</p><hr style="border: 0; border-top: 2px #A9A9A9 dotted;"/> </td> </tr> <tr> <td valign="top"> <div id="videodiv" style="margin-left:20px; padding-top: 7px;"> <div id="verVideo" style="width: 160; height: 40;"> <img width="200" height="160" style="cursor: pointer" src="./images/video.png"/> </div> <div style="padding-top: 5px; max-width: 200px;">
<HtmlOutputText escape="true" id="j_id277" rendered="true" style="font-size:12px;" transient="false" value="Promotional Video. Share it!"/>
</div> </div> </td> <td valign="top"> <div id="videodiv2" style="margin-right:20px;padding-top: 7px;"> <div id="verVideo2" style="width: 160; height: 40;"> <img width="200" height="160" style="cursor: pointer" src="./images/vasconoted3.png"/> </div> <div style="padding-top: 5px; max-width: 200px;">
<HtmlOutputText escape="true" id="j_id279" rendered="true" style="font-size:12px" transient="false" value="Presentation of Vasco Furtado in TEDxSudeste."/>
</div> </div></td></tr></table> </td> <td width="10px"/> <td width="478px"> <table style="margin-top: 10px; width: 478px;"> <tr> <td valign="top"><p class="toptitulo">#{messages['modal.wikicrimes.mobile']}</p><hr style="border: 0; border-top: 2px #A9A9A9 dotted;"/></td> </tr> <tr> <td> <div style="text-align:center;"> <p style="min-height: 35px;">
<HtmlOutputText escape="true" id="j_id281" rendered="true" style="font-size:14px;" transient="false" value="DOWNLOAD WikiCrimes for your mobile phone. (IN PORTUGUESE ONLY)"/>
</p> <div style="width:200px; float:left; margin-left: 20px;"> <img src="./images/icones_sites/iphone.jpg"/><br/> <a target="_BLANK" href="http://itunes.apple.com/br/app/wikicrimes/id399776422?mt=8"> <img height="48px" src="./images/icones_sites/wikicrimes.png"/> </a> <a target="_BLANK" href="http://itunes.apple.com/br/app/wikicrimes-opengov-sp/id473055780?mt=8"> <img height="48px" src="./images/icones_sites/opengov.png"/> </a> </div> <div style="width:200px; float:left; margin-left: 20px;"> <img style="margin-bottom:10px;" src="./images/icones_sites/android.gif"/><br/> <a target="_BLANK" href="https://market.android.com/details?id=org.wikicrimes"> <img height="48px" src="./images/icones_sites/wikicrimes.png"/> </a> <a target="_BLANK" href="https://market.android.com/details?id=br.com.wikinova.wikicrimes"> <img height="48px" src="./images/icones_sites/opengov.png"/> </a> </div> </div> </td> </tr> <tr> <td style=""> <div style="height: 100%; min-height: 72px;"><p style="text-align:justify">
<HtmlOutputText escape="true" id="j_id283" rendered="true" style="font-size:12px" transient="false" value="The WikiCrimes provides applications to keep yourself informed about the crimes through your own mobile device, Iphone, Ipad or devices that use the Android OS. "/>
</p></div> </td> </tr> </table> </td> </tr> </table> <script type="text/javascript"><!-- /* <![CDATA[ */ /*Link do download do mobile*/ function mostraDivBaixarWikicrimesMobile(){ //mostrarCarregandoPequeno(); document.getElementById("formReRenderLogin:btLoginSubmit").click(); closeMessage(); window.open("./paginaDownloadWikiMobile.html"); } makeCombos(); function verificaFiltrosAplicados() { var filtrosHtml = ""; // Sempre existira pelo menos um filtro aplicado (Credibilidade) filtrosHtml = "<span style='cursor: pointer; color:black;' title='"+ document.getElementById("filtroForm:idValorCredInic").innerHTML +" #{messages['estatisticas.area.visivel.credibilidade.periodo']} "+ document.getElementById("filtroForm:idValorCredFinal").innerHTML +"'> #{messages['scheduler.titulo.credibilidade']},</span>"; if(document.getElementById("tipoCrime").value!=0) { var textoHint = ""; if(document.getElementById("tipoCrime").value==1) textoHint ="#{messages['tipocrime.tentativaderoubo']}"; if(document.getElementById("tipoCrime").value==2) textoHint ="#{messages['tipocrime.tentativadefurto']}"; if(document.getElementById("tipoCrime").value==3) textoHint ="#{messages['tipocrime.furto']}"; if(document.getElementById("tipoCrime").value==4) textoHint ="#{messages['tipocrime.roubo']}"; if(document.getElementById("tipoCrime").value==5) textoHint ="#{messages['tipocrime.violencia']}"; filtrosHtml+=" <span title='"+textoHint+"'>#{messages['estatisticas.area.visivel.tipo.crime']}</span>,"; if(document.getElementById("tipoVitima").value!=0) { filtrosHtml+="<span> #{messages['estatisticas.area.visivel.subtipo.crime']}</span>," if(tipoLocal = document.getElementById("tipoLocal").value!=0){ filtrosHtml+="<span> #{messages['estatisticas.area.visivel.tipo.local']}</span>," } } } if(document.getElementById("dataInicial").value!='' || document.getElementById("dataFinal").value!=''){ filtrosHtml+=" <span style='cursor: pointer; color:black;' title='"+document.getElementById("dataInicial").value+" #{messages['estatisticas.area.visivel.data.periodo']} "+document.getElementById("dataFinal").value+"'>#{messages['scheduler.titulo.data']},</span>"; } if(document.getElementById("filtroForm:horarioInicial").value!=-1 && document.getElementById("filtroForm:horarioFinal").value!=-1){ filtrosHtml+=" <span style='cursor: pointer; color:black;' title='"+document.getElementById("filtroForm:horarioInicial").value+":00 #{messages['estatisticas.area.visivel.horario.periodo']} "+document.getElementById("filtroForm:horarioFinal").value+":00'>#{messages['scheduler.titulo.horario']},</span>"; } filtrosHtml= filtrosHtml.substring(0,filtrosHtml.length-8)+"</span>"; document.getElementById('divFiltrosAplicados').innerHTML = filtrosHtml; } function atualizaMapa(){ if(isUpdatingMap) return; isUpdatingMap = true; mostrarCarregandoPequeno(); verificaFiltrosAplicados(); //console.log("atualizaMapa 1"); updateStatistics(eventId, eventType); //console.log("atualizaMapa 2"); updateStatisticsGUI(); updateFilterGUI(); if(eventId) centerOnEvent(); updateKernelGUI(); escondeCarregandoPequeno(); document.getElementById("loading").style.visibility='hidden'; isUpdatingMap = false; } function forceMapUpdate(){ isUpdatingMap = false; atualizaMapa(); } function centerOnEvent(){ var center = new google.maps.LatLng(statistics.center.lat, statistics.center.lng); map.setCenter(center); map.setZoom(zoomLimiteInfMarcadores); var marker = crimesAtuais[eventId]; marker.setMap(map); showMarkerInfo(marker); eventId = null; eventType = null; } function updateStatisticsGUI(){ document.getElementById('divQtdeCrimesFiltrados').innerHTML = statistics.totalEvents; document.getElementById('graficoEstatisticasAV').innerHTML="<img title='#{messages['estatisticas.area.visivel.titulo.graf.ocorrencias']}' src='" + statistics.charts.types + "'/>"; document.getElementById('graficoRazoesAV').innerHTML="<img title='#{messages['estatisticas.area.visivel.titulo.graf.causas']}' src='" + statistics.charts.reasons + "'/>"; } function updateFilterGUI(){ if(defaultFilter){ document.getElementById("dataInicial").value = statistics.startDate; } } function updateKernelGUI(){ if(podeMudarModoKernel) if(kernelEnabled){ if(mudouZoom && map.getZoom() > zoomLimiteSupKernel){ desativaMapaKernel(); }else{ limpaCrimesAgrupador(); apagaMapaKernel(); pintaMapaKernel(); } }else{ if(mudouZoom && map.getZoom() < zoomLimiteInfMarcadores){ ativaMapaKernel(); } } mudouZoom = false; } // Ler os dados do arquivo texto enviado pelo servidor e constr�i os marcadores de crimes function constroiMarcadores() { var crimes = statistics.events; if(crimes){ linhas = crimes.split("\n"); i=0; plotaMarcadores(); }else{ document.getElementById("loading").style.visibility='hidden'; hideDivComment(); } } function plotaMarcadores() { //*DEBUG*/console.log("plotaMarcadores"); limpaCrimesOutOfBounds(id, idRelato); if (i < linhas.length-1){ var keep=Math.min(i + 30000, linhas.length-1); while (i < keep){ var dadosCrimeLinha = linhas[i].split("|"); var idCrime = dadosCrimeLinha[0]; var idTipoCrime = dadosCrimeLinha[1]; var lat = dadosCrimeLinha[2]; var long = dadosCrimeLinha[3]; var idCrime2 = dadosCrimeLinha[4]; var dataCrime = dadosCrimeLinha[5]; if(dataCrime != undefined){ var dia=dataCrime.substring(0,2); var mes = dataCrime.substring(3,5); var ano = dataCrime.substring(6,10); if (!filtrou) { var tempDataCrime = new Date(ano,mes-1,dia); if (tempDataCrime < tempDataMaisAntiga){ dataMaisAntiga=dataCrime; tempDataMaisAntiga=tempDataCrime; } } } if (id==idCrime2) id=idCrime; if(!crimesAtuais[idCrime]) { // Cria o marcador var marcador = createMarkerId(new google.maps.LatLng(lat, long),idTipoCrime,idCrime,dataCrime); crimesAtuais[idCrime]=marcador; //*********************** Kernel Map INICIO **************************** //coleta os crimes pra serem mandados pro servlet q gera o mapa de kernel //o if eh pra nao deixar plotar os marcadores qd o mapa de kernel estiver ligado arrayCrimesLatLng[index] = new crimeKernelMap(long, lat, marcador); ++index; //*********************** Kernel Map FIM **************************** // Google Agrupadores: Preenchendo Vetor de marcadores marcador.setMap(map); } i++ } if (document.getElementById("loading")){ var datainicial = document.getElementById("dataInicial").value; var datafinal = document.getElementById("dataFinal").value; document.getElementById("loadingMessage").innerHTML= "#{messages['webapp.carregando.crimes']} " + i + " #{messages['webapp.carregando.de']} " + (linhas.length-1) + "<br/> #{messages['webapp.carregando.periodo']}: " + datainicial + " #{messages['webapp.carregando.a']} " + datafinal; } //window.setTimeout(plotaMarcadores,1); }else { document.getElementById("loading").style.visibility='hidden'; document.getElementById("loadingMessage").innerHTML="#{messages['webapp.carregando.crimes']}". i=0; } if (!filtrou) { document.getElementById("dataInicial").value=dataMaisAntiga; verificaFiltrosAplicados(); dataInicial=dataMaisAntiga.split("/"); } } function plotaEstados() { document.getElementById("loading").style.visibility='hidden'; i=0; totalCrimes=0; while (i < linhas.length-1){ var dadosCrimeLinha = linhas[i].split("|"); var sigla = dadosCrimeLinha[0]; var qtd = dadosCrimeLinha[1]; var lat = dadosCrimeLinha[2]; var long = dadosCrimeLinha[3]; totalCrimes+=parseInt(qtd); // Cria o marcador var marcador = createMarkerGroup(new google.maps.LatLng(lat, long),sigla + ' (' + qtd + ')'); // Adiciona o marcador ao mapa i++ } } function setaSubmeteuFiltro(){ submeteu = true; defaultFilter = false; for (k in crimesAtuais) { removeComment(k); crimesAtuais[k].setMap(null); delete crimesAtuais[k]; } } /*Funcao que habilita/desabilita a lista contendo as entidades certificadoras cadastradas*/ function habilitaListaEntidadeCertificadora(){ var listaHabilitada = document.getElementById("filtroForm:entidadeCertificadora").disabled; if(listaHabilitada == true){ document.getElementById("filtroForm:entidadeCertificadora").disabled = false; document.getElementById("filtroForm:entidadeCertificadora").selectedIndex = 1; } else { document.getElementById("filtroForm:entidadeCertificadora").disabled = true; document.getElementById("filtroForm:entidadeCertificadora").selectedIndex = 0; } } /* ]]> */ --></script>
</HtmlForm>
</HtmlPanelGrid>
<script type="text/javascript"> Calendar.setup( { inputField : "dataInicial", // ID of the input field ifFormat : "#{messages['date.format.calendar']}", // the date format button : "triggerINI", // ID of the button weekNumbers : false } ); Calendar.setup( { inputField : "dataFinal", // ID of the input field ifFormat : "#{messages['date.format.calendar']}", // the date format button : "triggerDF", // ID of the button weekNumbers : false } ); </script> <script type="text/javascript" src="./scripts/jquery-1.4.2.js"/> <script type="text/javascript" src="./scripts/jquery.corner.js"/> <script type="text/javascript"> // animation jQuery.noConflict(); jQuery('#verVideo').click(function(){ openModal('./video1.html',470, 375,'#{messages['video.titulo1']}', this) }); jQuery('#verVideo2').click(function(){ openModal('./video2.html',470, 375,'#{messages['video.titulo2']}', this) }); </script> </body> </html>
<br/>
</div> </TD> </TR> <TR> <TD align="center" colspan="2" height="20px"> <div id="footer">
<br/>
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"> <body> <div> <p class="toptitulo" align="left">
<HtmlOutputText escape="true" id="j_id291" rendered="true" title="People who liked WikiCrimes" transient="false" value="People who liked WikiCrimes"/>
</p> <hr style="border: 0; border-top: 2px #A9A9A9 dotted;"/> </div> <div style="width: 100%;"> <iframe id="iframeCurtir" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.wikicrimes.org&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="margin-top: 5px; border:none; overflow:hidden; width: 100%; height:80px;" allowTransparency="true"/> </div> <br/> <!-- <table style="width: 100%;">--> <!-- <tr><td><p class="toptitulo" align="center"><h:outputText value="#{messages['message.facebook']}"--> <!-- title="#{messages['message.facebook']}" /></p><hr style="border: 0; border-top: 2px #A9A9A9 dotted;" /></td></tr>--> <!-- <tr>--> <!-- <td style="text-align: center; width: 100%;">--> <!-- <div style="text-align: center">--> <!-- <iframe id = "iframeCurtir" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.wikicrimes.org&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="margin-top: 5px; border:none; overflow:hidden; width:100%; height:80px;" allowTransparency="true"></iframe>--> <!-- </div>--> <!-- <br/> --> <!-- </td>--> <!-- </tr>--> <!-- </table>--> <!-- <rich:panel id="divCurtir" style="width:982px; height:90px; text-align: center;"--> <!-- header="#{messages['message.facebook']}">--> <!-- <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.wikicrimes.org&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="margin-top: 5px; border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>--> <!-- </rich:panel> --> <br/>
<HtmlOutputLink disabled="false" id="j_id293" onclick="openModal('./quemSomos.html',550,320, 'WikiCrimes.org - About us', this);" rendered="true" transient="false" value="#">
<HtmlOutputText escape="true" id="j_id294" rendered="true" title="Who develops this project" transient="false" value="About us"/>
</HtmlOutputLink>
|
<HtmlOutputText escape="true" id="j_id296" rendered="true" transient="false" value=" "/>
<HtmlOutputLink disabled="false" id="j_id297" onclick="openModal('./faleConosco.html', 600, 426,'Contact us', this);return false" rendered="true" transient="false" value="#">
<HtmlOutputText escape="true" id="j_id298" rendered="true" title="Contact us..." transient="false" value="Contact us"/>
</HtmlOutputLink>
|
<HtmlOutputText escape="true" id="j_id300" rendered="true" transient="false" value=" "/>
<HtmlOutputLink disabled="false" id="j_id301" onclick="return showAjuda('http://74.55.152.242:8080/cs/livehelp.php?department=1', 580, 500);" rendered="true" transient="false" value="#">
<HtmlOutputText escape="true" id="j_id302" rendered="true" title="On-line Help!" transient="false" value="On-line Help"/>
</HtmlOutputLink>
|
<HtmlOutputText escape="true" id="j_id304" rendered="true" transient="false" value=" "/>
<HtmlOutputLink disabled="false" id="j_id305" onclick="openModal('./perguntasFrequentes.html',730, 250,'FAQ', this);return false;" rendered="true" transient="false" value="#">
<HtmlOutputText escape="true" id="j_id306" rendered="true" title="See the FAQs..." transient="false" value="FAQ"/>
</HtmlOutputLink>
|
<HtmlOutputText escape="true" id="j_id308" rendered="true" transient="false" value=" "/>
<HtmlOutputLink disabled="false" id="j_id309" onclick="openModal('./termosUso.html', 682, 400,'Terms of use', this);return false" rendered="true" transient="false" value="#">
<HtmlOutputText escape="true" id="j_id310" rendered="true" title="This project terms of use" transient="false" value="Terms of use"/>
</HtmlOutputLink>
|
<HtmlOutputText escape="true" id="j_id312" rendered="true" transient="false" value=" "/>
<HtmlOutputLink disabled="false" id="j_id313" onclick="openModal('./sobre.html', 660, 220,'What is', this);return false" rendered="true" transient="false" value="#">
<HtmlOutputText escape="true" id="j_id314" rendered="true" title="Know more about WikiCrimes.org" transient="false" value="What is"/>
</HtmlOutputLink>
</body> </html>
</div> </TD> </TR> </TABLE> </div> <div id="mascara" onclick="closeModal('modal')"/> <div id="branco"/> <div id="modal"> <div id="xfecha"><a onclick="closeModal('modal')" style="cursor: pointer;"><img border="0" src="./images/bt_modal_fechar.png" width="29" height="29"/></a></div> <div id="modal_cima"> <div id="topo_esq"/> <div id="topo_meio"/> <div id="topo_dir"/> </div> <div id="modal_corpo"> <div id="corpo_esq"/> <div id="corpo_meio"> <!-- Aqui pode ser colocado o conte�do --> <div id="modalConteudo"/> <!-- Aqui pode ser colocado o conte�do --> </div> <div id="corpo_dir"/> </div> <div id="modal_bottom"> <div id="bottom_esq"/> <div id="bottom_meio"/> <div id="bottom_dir"/> </div> </div> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-3266136-1"); pageTracker._initData(); pageTracker._trackPageview(); </script> <script> //Pog pra funcionar no Chrome /*setTimeout(function(){ if(!chamouLoadMapa){ loadMapa(); } },50);*/ </script> </body> </html>
</AjaxViewRoot>

+ Scoped Variables

Request Parameters
NameValue
None
Request Attributes
NameValue
ajaxContextorg.ajax4jsf.context.AjaxContextImpl@3b980e02
messagescom.sun.facelets.tag.jsf.core.LoadBundleHandler$ResourceBundleMap@7bbfc3de
mostrarDadosFormorg.wikicrimes.web.MostrarDadosForm@6ad4634a
requestURLhttp://www.wikicrimes.org/main.html
Session Attributes
NameValue
filtroFormorg.wikicrimes.web.FiltroForm@1dc2c611
Application Attributes
NameValue
a4jSkin{shadowBackgroundColor=#000000, tableBorderColor=#C0C0C0, buttonSizeFont=11, selectControlColor=#E79A00, headerWeightFont=bold, tabSizeFont=11, generalTextColor=#000000, headerTextColor=#000000, buttonFamilyFont=Arial, Verdana, sans-serif, calendarSpecBackgroundColor=#E4F5E2, calendarWeekBackgroundColor=#F5F5F5, controlBackgroundColor=#ffffff, tableFooterBackgroundColor=#cccccc, calendarCurrentBackgroundColor=#FF7800, calendarHolidaysTextColor=#FF7800, tabDisabledTextColor=#8DB7F3, tipBackgroundColor=#FAE6B0 , shadowOpacity=1, generalSizeFont=11px, headerFamilyFont=Arial, Verdana, sans-serif, tableSubfooterBackgroundColor=#f1f1f1, tabFamilyFont=Arial, Verdana, sans-serif, tipBorderColor=#E5973E , tabBackgroundColor=#C6DEFF, calendarSpecTextColor=#000000, generalBackgroundColor=#FFFFFF, headerSizeFont=11px, calendarCurrentTextColor=#FFEBDA, generalLinkColor=#0078D0, panelBorderColor=#BED6F8, calendarHolidaysBackgroundColor=#FFEBDA, tableBorderWidth=1px, visitedLinkColor=#0090FF, headerBackgroundColor=#BED6F8, additionalBackgroundColor=#ECF4FE, hoverLinkColor=#0090FF, headerGradientColor=#F2F7FF, tableBackgroundColor=#FFFFFF, subBorderColor=#ffffff, trimColor=#D6E6FB, generalFamilyFont=Arial, Verdana, sans-serif , controlTextColor=#000000}
29/08/2014 11:08:21 - Generated by Facelets