Giter Club home page Giter Club logo

nette-forms-gpspicker's People

Contributors

bazo avatar marian-r avatar vojtech-dobes 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nette-forms-gpspicker's Issues

Crossdomain stylesheets

Hello,

when first css style in page is from another domain, then JS fails on:

var stylesheet = window.document.styleSheets[0];
var method = stylesheet.cssRules ? 'insertRule' : 'addRule';
for (var i = 0; i < rules.length; i++) {
    stylesheet[method].call(stylesheet,  rules[i], 0);

because JS in Firefox can't modify cross domain css.

I'm suggesting as solution add this code into loop, try+catch and if try was successful, then break loop. If is caught exception, then do next loop iteration with next styleSheets.

Do you agree with this solution, so I can prepare commit?

Add option to let user enter GPS by himself

It'd be cool to let uset enter GPS by himself - sometimes you may have an exact GPS coordinate written somewhere on paper and entering it directly would save time (and through browsing map).

  • check for typing/paste into lat/lng inputs
  • try to update map according to typed values

Add possibility to leave the GPS picker not filled

Currently the GPS picker is always filled, if you don't change anything then the value is the hardcoded default position, so it's not really possible to have GPS picker as optional field in form.
I think the default position should be used only for setting initial map center and on backend the GPS picker should return NULL if not filled in by user. Also, it would be nice to be able to change the default position.

Mobile friendliness

When using the picker on smartphone, UI could be improved:

  • when dragging the marker, it should be twice as big to remain visible under the finger
  • when setting the marker by one touch, it should blink twice as big to confirm the change

It might also detect <meta name="viewport" content="width=device-width"> and set its width to 100%, but I am not sure about this one.

Get address from currently position of picker after send form

Is posible to add a feature to get currently address, if user change possition of picker manualy and send the form without field the address?

I mean something like below:

public function formValidate(Form $form)
{
  $values  = $form->getValues();

  if($values->coordinates->address==null)
  {
    $adress = $form["coordinates"]->getPickerAddress(); 
    ....

nette 2.2 compatibility

GpsPickerExtension.php

line 37
from
$latte->addSetup('VojtechDobes\NetteForms\GpsPickerMacros::install(?->compiler)', array('@self'));
to
$latte->addSetup('VojtechDobes\NetteForms\GpsPickerMacros::install(?->getCompiler())', array('@self'));

Adding setRequired() causes an error on submit

When I add GpsPicker and set it required, validation fails with the message:

Object of class VojtechDobes\NetteForms\GpsPoint could not be converted to string

$form->addGpsPicker(...)->setRequired();

Problem is in BaseControl::isFilled() where typecast to string is used.

Not sure if this behavior is currently supported?

Problem with install to Nette 2.3.6

Hello I am trying install GPS component to my app but I get error from composer

Installation request for nette/application (locked at v2.3.13, required as ^2.3.6) -> satisfiable by nette/application[v2.3.13].

client side

riadok 55 options.search = new google.maps.places.Autocomplete($search[0], {});

chyba: TypeError: google.maps.places is undefined

options.search = new google.maps.places.Autocomplete($search[0], {});

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.