Git Product home page Git Product logo

kirby-locator's People

Contributors

afbora avatar medienbaecker avatar piotrf avatar renestalder avatar s1syphos avatar sebastiangreger avatar sylvainjule avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kirby-locator's Issues

After dragging the marker the lat/lon format will change

When I move the marker on the map the coordinates are saved in XX.XXX and YY.YYY format, with a comma as decimal separator and with Citation marks. When I locate an address, lat and lon are saved in XX.XXX and YY.YYY format without citations.

Store `osm_id` from response

hey there,
would you be interested in eg a field method toLocationLink() to get the openstreetmap node link for a given POI? or would that be something you don't deem necessary? I'd make an API call to nominatim's reverse function and cache the result, that's about it ..

I'd provide a PR if it's of interest, just let me know the best way to pursue this (page method, field method, etc)

// Edit:
I propose storing osm_id from the response you get from Nominatim, since it represents the Node ID being used in OpenStreetMap links, eg https://openstreetmap.org/node/OSM_ID - that would save a call to the API using lat / lon to get it ..

Cheers!

Change(able) order of info

While you can already change the displayed information, the order is fixed. But for German clients I would rather like to display the number after the street. That's how we write it. And I guess some people would like to use a completely different order.

For this you would have to change the display.includes('address') in your Locator.vue to a loop iterating over the display array.

hausnummer

lon and lat output is with comma, instead of dot

When I put marker on the map, I get lon and lat with dots, like: 58.529276, 1.449215, but when I search for location and save like it's found, output is with comma for one or both, like: 58,529276, 1.449215

Unexpected values with "geocoding: mapbox"

First of all thank you for this wonderful plugin.

I'm not sure this is really an issue, but by setting geocoding: mapbox the latitude and longitude values are returned by the toLocation method with a comma and not with a dot.

Nominatim:
<?= $location->lat() ?> // 41.894802

Mapbox:
<?= $location->lat() ?> // 41,894802

This difference can cause some problems in the frontend implementation of the map.

In the content folder the values lat and lon are stored differently between mapbox and nominatim.

Nominatim geocoding:

Map: 

lat: "41.894802"
lon: "12.4853384"
city: Roma
country: Italia

Mapbox geocoding:

Map: 

lat: 41.894802
lon: 12.4853384
city: Roma
country: Italia

correct street found, but city is not saved

I had several cases where the search found the correct street with the right postal code, but for some reason the city is not being saved.

AC

  • enter "Bleibtreustraße 33 Berlin" in search and hit locate
  • all data is saved (see gif) except the city "Berlin"

Screen Recording 2020-10-22 at 05 08 34 PM

Save zoom factor

I would love if the zoom factor gets stored as well, so I can choose the right one in the Panel that I want to replicate on the front-end.

Doesn't work inside structures

bildschirmfoto von 2018-12-05 17-12-19

The red bar should be the locator field.
When I decrease the indentation of the exact same field (to lift it out of the structure field) it displays and works as expected.

[panel] mapbox doesn't load when using a token with url restrictions

Hello Sylvain :)

In the panel, Mapbox tiles can't be loaded when using a "non public" token.
This is because the Kirby panel (since 3.4) blocks the referrer header (here).

I don't know if this should be an issue with Locator, the Kirby panel or Leaflet.

Locator could circumvent this issue by overriding the meta tag, with something like:

document.querySelector("meta[name=referrer]").content = "origin";

Kirby could solve this by using a less strict referrer policy. Something like "origin" or "no-referrer-when-downgrade"...

Leaflet could solve this by adding a referrer policy to their tiles. Actually they did this a few days ago, but considering their last "release" was in september 2020, I don't know how long it will take to get this option in a stable version...

I will crosspost an issue also on Kirby, and then link here.

4.0 Compatibility

Tested on 4.0.0-alpha.3 and working great! There is just minor UI issue:

  • Dialog UI

screen-capture-1610-Test - Mægazine-localhost

  • Reset button position
  • Empty text icon size

The field type "location" does not exist

While the plugin is correctly installed (and other plugins work fine) I somethow get the following error message with the latest nightly build:

image

"location" is the field name, not field type, in this case:

fields:
  location:
    type: locator

The field type "mymap" does not exist

Hello,

Thank you very much for this plugin. I’m struggling to have it set up with my blueprints:

  1. I run composer require sylvainjule/locator
  2. Tried simply adding the following nested under blueprint’s fields:
  mymap:
    type: locator
    tiles: wikimedia

I’d expect this to add locator field in the panel but I get The field type "mymap" does not exist. Am I doing something wrong?

Feature suggestion: Panel view to display a collection of locator-pages on a map

I've been using this plugin for a handful of sites that include, in some way or another, a collection of multiple pages with locator fields. In the frontend, all pages are output as a set of markers on a full-screen map, each having a popup or linking to a page etc.

I'd like to suggest building an "all locations"-view as an optional panel section. This could display multiple markers on a large map, each marker linking to the respective page in the panel. I know it will come in handy at least for my current/upcoming projects.

Is this something you would consider building/reviewing a pull request for? I'll be working on at least one or two map sites this year, so these projects could justify helping out with such an addition to this plugin.

Error: The locator field is missing. Please add it to your installed fields or remove it from your blueprint

Hello @sylvainjule ,

After a clean install of kirby-webpack, I tried to install your plugin, but have this message:
The locator field is missing. Please add it to your installed fields or remove it from your blueprint

image

Here is my blueprint:

title: Step
preset: page
pages: false

fields:
  map:
    label: Location
    type: locator

I'm in the right folder:
image

Don't understand what's going on....

Thanks for your help!

Follow the composer instructions

Hi,

please follow the kirby composer instructions

Both the type field and the getkirby/composer-installer dependency are required for your plugin to work, otherwise it won't be loaded correctly by Kirby.

The setup with a separate config.php file for Composer is no longer recommended as it can cause issues with the autoloading order. If you put your code directly into the index.php file and don't autoload it with Composer, Kirby will pick it up just fine.

https://getkirby.com/docs/guide/plugins/plugin-setup-basic#the-composer-json


Also what's the purpose of adding the vendor dir to git?

The field type "wathever" does not exist

Hello,
I installed the last version of locator and an error message keeps popping in kirby's panel:
"The field type "wathever" does not exist"
I tried to change the field name and the massage still is the same, with the new name between the quotation marks.
Here is a screenshot of the setup:
Screenshot_2022-03-03-09-40-25_1920x1080
Normally everything should be fine but as I am learning coding, it could be my mistake...
Thank you for your work, it would be great if locator was integrated in kirby, it seems an essential function to me.

Save country code along other data

In case this is possible from the data we can gather from the geolocation apis, it would be cool to include the country code in the data. This would allow showing a translated country name in the frontend by passing the country code to PHP internals, e.g. Locale::getDisplayRegion.

Location address not being found when location is at a square, not a street

When using Nomatim I had a strange bug that for some locations an address wouldn't be found while still returning house numbers and the location itself correctly. Some digging let me tho this line:

'address': response.address.road,

In my case the location was actually at a (market) square so naturally the resonse address wasn't a road.

To fix this I suggest you change the line to:

'address': response.address.road ?? response.address.road ?? response.address.square,

So if no road is found the square will be used.

Cheers for the great plugin I thought it might be useful to anyone else struggling with this issue ✌️

Drop a marker/pin manually?

I was wondering if there is any way to simply drop a pin on the map? It's somewhat related to #33 as we need to locate items that are not going to be easily geocoded. The workaround is to currently search for something in the vicinity and then drag the marker to the appropriate location.

(Thank you for this wonderful plugin!)

The field type "<field_name>" does not exist

I'm using Kirby 3.2.2 and getting this error when using the locator field. This is what my blueprint looks like:

title: Location

tabs:
  content:
    label: Content
    icon: document
    columns:
      - width: 2/3
        fields:
          page_content:
            label: Text
            type: textarea
            size: small
          mymap:
            label: Map
            type: locator

image

Wrong links for voyager/positron

In the readme where the terms of services for the different tile services are listed, positron and voyager seem to have the same link. Also, this link doesn't point to the terms of services.

As I don't know any of those services (also couldn't find voyager by searching) I can't really contribute and fix the link myself. Positron also seems to link to "carto", which I'm not even sure if this is correct.

Option to display only the map without location fields

Would it be possible to have the option to display only the map, without the area that contains the lat/lng or other data?

I tried passing false to the display option, but in that case the map is just a few pixels high.

Find state too?

I used to have the State stored in our project data at nehforall.org, but now I see this plugin doesn't return the state by default. Is there a way to turn that data on? We really need it for our svg state icons.

composer installation fails

Hi! I tried to install it with composer require sylvainjule/locator on dev-master 3.0.0-beta-6.17.
But I get this error:

[InvalidArgumentException]
  Could not find a matching version of package sylvainjule/locator. Check the package spelling, your version constrai
  nt and that the package is available in a stability which matches your minimum-stability (beta).

Locator options in Structure field

When used in a Structure Field, the options settings don't seem to work

locations:
  label: Locations
  type: structure
    fields:
      coordinates:
        label: Location
        type: locator
        draggable: false # <- Still draggable

Does also not work, if I set the options globally in the config file.

Entering Latitude Longitude directly

Hey, thank you for the nice plugin. I was wondering if there is a way to enter latitude longitude directly. This would be very helpful if the geolocation does not work for whatever reason and dragging the map is not an option.

Add max-height to map

With the 50vh height, the map seems a bit massive on larger screens. Especially in smaller columns. Maybe a max-height would be good?

image

Error when move location on map

This locator plugin is working well for us. However, when i try to actually edit the location with my mouse I'm getting this error: Any ideas about how to correct for it? Thanks
Screen Shot 2022-05-10 at 10 31 12 AM

Hide map?

It would be handy to have an option to hide the map after the location has been assigned. It takes up quite a bit of room and is only needed the first time you use the field.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.