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

.on() event snot working #240

Open
BatuhanCakir opened this issue Jun 22, 2021 · 0 comments
Open

.on() event snot working #240

BatuhanCakir opened this issue Jun 22, 2021 · 0 comments

Comments

@BatuhanCakir
Copy link

BatuhanCakir commented Jun 22, 2021

Hi,
I wanted to use the turorial snippet
osmb.on('pointerup', e => { if (e.target) { osmb.highlight(e.target.id, '#f08000'); } else { osmb.highlight(null); } });

but it doesnt work i doesnt get the target when i click on a building
Below is the code snippet
`
var osmb = new OSMBuildings({
container: "map",
position: { latitude: 49.194713, longitude: 8.113354 },
zoom: 16,
minZoom: 15,
maxZoom: 20,
tilt: 80,
effects: ['shadows'],
});

  osmb.addMapTiles("https://api.mapbox.com/styles/v1/osmbuildings/cjt9gq35s09051fo7urho3m0f/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1Ijoic2x1c2g5OSIsImEiOiJja3E2ajFkbXgwMmQ2MnBvNjM3NDZ6Z3M4In0.Xd7zhc8irFyXULovXCp91A"
  );
  osmb.addGeoJSON("http://192.168.5.135:3000/3dbuildings.json");
  /* osmb.highlight((feat) => {
    return 'red';
  })
  */
 osmb.on("pointerdown", (e) => {
   console.log(e);
 })`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant