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

Geomap: Looking for JS code to Filter a point #9726

Open
Michael-Transport opened this issue Jan 30, 2024 · 8 comments
Open

Geomap: Looking for JS code to Filter a point #9726

Michael-Transport opened this issue Jan 30, 2024 · 8 comments

Comments

@Michael-Transport
Copy link

Based your Dynamic map example, you have a table below the map which contains the Points() to show.. .Next to each row there is a magnifying glass, that when selected takes you to that point.

Can you please share the JS code that does that..

@prosperva
Copy link

Are you using open layers?

@Michael-Transport
Copy link
Author

Are you using open layers?

Good morning,

I don't think I am, but to be honest I'm not quite sure. This is all very new to me and I'm just starting with trying to implement that examples you have on your website.

This one in particular is a copy of the Dynamic Map you have on your site; except I'm trying to implement a button for each of the locations I plot on the map (in addition to the table). I would prefer to use a layer file instead of the Table as I don't want to show the table but want the "Pop up" features that the table provides, so for now I'm just starting with a Table example.

That being said, as I stated above, I'm using your example so whatever you are doing behind the scenes to build that clickable magnifying glass (the clickable link just says javascript::, and nothing else, so you must be trapping the event behind the scenes) in the table is what I'm trying to do with a button click and a client-side JS call to move the map to the Point(X,Y) that is defined for that button (and subsequent location)

@prosperva
Copy link

Can you share which example you are using?

@Michael-Transport
Copy link
Author

Can you share which example you are using?

https://wet-boew.github.io/v4.0-ci/demos/geomap/geomap-en.html

The Dynamic map example on this page.

@Michael-Transport
Copy link
Author

Michael-Transport commented Jan 31, 2024 via email

@prosperva
Copy link

prosperva commented Jan 31, 2024

In each row of the table you will notice that it has point coordinates as follows:

<tr data-geometry="POINT (-79.3847 43.6476)" data-type="wkt" id="5lld1ekn3ot">

using on click, you will need to pas those points to open layers function that goes to those points

{e.getView().setCenter(ol.proj.transform([-75.70535,45.3995],"EPSG:4326","EPSG:3978")),e.getView().setZoom(5)}

You can get some explanation here: https://openlayers.org/en/latest/examples/animation.html

@Michael-Transport
Copy link
Author

In each row of the table you will notice that it has point coordinates as follows:

<tr data-geometry="POINT (-79.3847 43.6476)" data-type="wkt" id="5lld1ekn3ot">

using on click, you will need to pas those points to open layers function that goes to those points

{e.getView().setCenter(ol.proj.transform([-75.70535,45.3995],"EPSG:4326","EPSG:3978")),e.getView().setZoom(5)}

You can get some explanation here: https://openlayers.org/en/latest/examples/animation.html

Thank you, I will test this out.

Also, can I use the overlayers syntax directly and code the mapping functions directly like the examples on this site:

https://openlayers.org/doc/quickstart.html
Or do I have to use the built in functions and methods of the geomap.lib.js?

@prosperva
Copy link

These are open layers built in methods

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

2 participants