Comments (5)
Hi mirzadelic,
There's not at the moment. It's a good idea though! Are you able to provide an example where this might be useful? One that I can think of myself is when you allow users to add markers by clicking on the map. You might want to limit the number of markers they can add themselves.
I'll look at getting it added to the library over the weekend.
Thanks,
Steve
from codeigniter-google-maps-v3-api-library.
I don't have example for that but there is example for only 1 marker on click, not on drag but on click.
from codeigniter-google-maps-v3-api-library.
Hi BIOSTALL,
Here I have an example,
In my project user will enter the locaton name and I am generating map using your library. Thanks for that.
And I am giving option to select his exact loction and asking the user to place the marker.
Here I have to limit the user to place only one marker. It may be dragable.
So please help me to do this.
And I have one more question
Is there any way to get user lattitude and longitude after user place the marker on the map and I want to store these values in my database.
Is it possible? If possible please give me an example.
Thank you very much.
from codeigniter-google-maps-v3-api-library.
Look at this example: http://biostall.com/demos/google-maps-v3-api-codeigniter-library/dragmarker
$this->load->library('googlemaps');
$config['center'] = '37.4419, -122.1419';
$config['zoom'] = 'auto';
$this->googlemaps->initialize($config);
$marker = array();
$marker['position'] = '37.429, -122.1419';
$marker['draggable'] = true;
$marker['ondragend'] = 'alert(\'You just dropped me at: \' + event.latLng.lat() + \', \' + event.latLng.lng());';
$this->googlemaps->add_marker($marker);
$data['map'] = $this->googlemaps->create_map();
$this->load->view('view_file', $data);
Make hidden input in form and values and submit with this:
$marker['ondragend'] = '$('#lat_id').val(\' + event.latLng.lat() + \'); $('#lng_id').val(\' + event.latLng.lng() + \');';
Not testeD, but it should work.
Btw this code is for jQuery..
from codeigniter-google-maps-v3-api-library.
I got it thank you very much mirzadellc
from codeigniter-google-maps-v3-api-library.
Related Issues (20)
- PHP Strict Standards: Only variables should be assigned by reference ?
- Broken link for google maps clustering markers HOT 6
- Oops! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console HOT 5
- Geolocation returning 0,0 for all addresses HOT 1
- kmllayer
- morris.js (Morris Line&Bar charts) on "infowindow_content"
- Methods with the same name as their class will not be constructors. HOT 2
- It is posible to use isLocationOnEdge with this Library
- Error HOT 2
- Change directions marker icon HOT 1
- how show result the autocomplete in the map?
- Current location Issue HOT 2
- How to get long and lat of user location ?
- Multiple Maps On The Same Page - Double Marker In One Maps if Draggable TRUE
- add_marker by address too slow when there are 100+ markers HOT 2
- Clustering doesn't work. HOT 2
- Googlemaps has a deprecated constructor. HOT 2
- Homepage & Demo links not working? HOT 1
- Direction HOT 1
- marker on map not clickable even titel not whowing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeigniter-google-maps-v3-api-library.