vojtech-dobes / nette-forms-gpspicker Goto Github PK
View Code? Open in Web Editor NEWForm control for picking coordinates (for Nette Framework)
Home Page: http://vojtechdobes.com/gpspicker/
Form control for picking coordinates (for Nette Framework)
Home Page: http://vojtechdobes.com/gpspicker/
Also could be method for setting marker into center of current view.
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?
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).
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.
When search is used, much more could be moved to server. But this should be implemented together with serverside.
Dependency for Nette in composer.json is restricted to version <2.3.
when adding gps picker to form like this, latest version
$form->addGpsPicker('coords', 'Coordinates:');
shouldn't this work out of the box?
If you include GpsPicker in form, without setting any value, InvalidArgumentException is thrown while rendering control. This is because in Nette 2.1 there is NULL set as a default value.
When using the picker on smartphone, UI could be improved:
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.
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();
....
would it be possible to get also the address that belongs to the point selected?
[data-nette-gpspicker] img {
max-width: none;
}
Google Maps API is limited in usage. GpsPicker might be implemented in other mapping services to let developer choose.
{gpspicker coords}
{label lat}Latitude{/label} {input lat}
{label lng}Longitude{/label} {input lng}
{/gpspicker}
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?
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].
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], {});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.