Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with OpenStretMap #1043

Closed
Catucuamba opened this issue Dec 13, 2018 · 5 comments
Closed

problem with OpenStretMap #1043

Catucuamba opened this issue Dec 13, 2018 · 5 comments
Assignees
Milestone

Comments

@Catucuamba
Copy link

Catucuamba commented Dec 13, 2018

if I use a <b:openStreetMap> inside of a form it don work, the message say:

Uncaught Error: Map container not found

and I inspect the script and found :

> var fmrConsultasIndividualesmapa_map = L.map('**fmrConsultasIndividualesmapa**',.... 

The bug is that the id container is badly built, the correct will be

var fmrConsultasIndividualesmapa_map =  L.map('**fmrConsultasIndividuales:mapa**',...

sorry if my english is bad.

Al utilizar un <b:openStreetMap> dentro de un form me da problemas, el script que se genera automáticamente está mal, conforme se indica en las líneas superiores, favor su colaboración solventado este error.

This is my code:
Este es el código utilizado:

<b:form id="fmrConsultasIndividuales" styleClass="vertical_align_top">
             <b:openStreetMap id="mapa" width="100%" height="500px" center="42.3402,-3.6972"  />
</b:form>
@Catucuamba
Copy link
Author

Catucuamba commented Dec 13, 2018

I found the error:
In the package:

package net.bootsfaces.component.openStreetMap;

in the class:

public class OpenStreetMapRenderer extends CoreRenderer

in the method:

public void encodeEnd(FacesContext context, UIComponent component) throws IOException {

you have:

String **clientIdRaw** = openStreetMap.getClientId();
String **clientId** = clientIdRaw.replace(":", "");
...
rw.writeText("var " + clientId + "_map = L.map('" + **clientId** + "', {center: [" + 
                     openStreetMap.get......

In my opinion, the correct way will be:

rw.writeText("var " + clientId + "_map = L.map('" + **clientIdRaw** + "', {center: [" + openStreetMap.get......

@stephanrauh
Copy link
Collaborator

¡Gracias por tu análisis!

@stephanrauh
Copy link
Collaborator

stephanrauh commented Dec 13, 2018

Acabó reproducir tu bug. Parece que tu solución funciona bien. Es una sorpresa, por qué librerías como jQuery no funcionan con los ids de JSF.

@stephanrauh
Copy link
Collaborator

He cargado BootsFaces 1.4.1-SNAPSHOT al Maven Central. Mira al #369 para aprender como descargarlo en tu project. ¿Quieres probarlo?

@stephanrauh stephanrauh self-assigned this Dec 13, 2018
@stephanrauh stephanrauh added this to the v1.4.1 milestone Dec 13, 2018
stephanrauh added a commit to TheCoder4eu/BootsFacesWeb that referenced this issue Dec 16, 2018
…on to make sure the feature isn't broken again in future
@stephanrauh
Copy link
Collaborator

Done and documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants