Comments (28)
Hi there,
I will need to push a change to allow shapes to be visible externally. I am on with this change now, and will report back with usage.
from googlmapper.
Okay, i've pushed a change and versioned it as v2.12.0/v1.8.0, with the require changes.
You can achieve what you need with the following:
Mapper::map(53.3, -1.4, ['eventAfterLoad' => 'circleListener(maps[0].shapes[0].circle_0);']);
<script type='text/javascript'>
function circleListener(circle) {
circle.addListener('radius_changed', function()
{
console.log(circle.getRadius());
console.log(circle.getCenter().lat());
console.log(circle.getCenter().lng());
});
circle.addListener('center_changed', function()
{
console.log(circle.getRadius());
console.log(circle.getCenter().lat());
console.log(circle.getCenter().lng());
});
}
</script>
from googlmapper.
thank you very much
i am waiting for you
2016-07-27 8:43 GMT+01:00 Bradley Cornford [email protected]:
Hi there,
I will need to push a change to allow shapes to be visible externally. I
am on with this change now, and will report back with usage.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgvjNpzNY6EgD-LMtHkhzXOupd0Izks5qZww6gaJpZM4JVMmm
.
from googlmapper.
Does the above work for you?
from googlmapper.
I have not yet tested,
i will give you a feedback
2016-07-27 13:31 GMT+01:00 Bradley Cornford [email protected]:
Does the above work for you?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgqfnMBoHuxLwglSNh6iJZo2SZu4iks5qZ0-ggaJpZM4JVMmm
.
from googlmapper.
hi Bradley,
it did not work
2016-07-27 13:33 GMT+01:00 arouna perez [email protected]:
I have not yet tested,
i will give you a feedback2016-07-27 13:31 GMT+01:00 Bradley Cornford [email protected]:
Does the above work for you?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgqfnMBoHuxLwglSNh6iJZo2SZu4iks5qZ0-ggaJpZM4JVMmm
.
from googlmapper.
are you missing something?
2016-07-27 15:04 GMT+01:00 arouna perez [email protected]:
hi Bradley,
it did not work2016-07-27 13:33 GMT+01:00 arouna perez [email protected]:
I have not yet tested,
i will give you a feedback2016-07-27 13:31 GMT+01:00 Bradley Cornford [email protected]:
Does the above work for you?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgqfnMBoHuxLwglSNh6iJZo2SZu4iks5qZ0-ggaJpZM4JVMmm
.
from googlmapper.
Have you run 'composer update cornford/googlmapper' ?
from googlmapper.
yes i update my composer
here is my code in controller
$map=Mapper::map($response->getLatitude(), $response->getLongitude(),
['zoom' => 16,'draggable' => true, 'marker' => false],['eventAfterLoad' =>
'circleListener(maps[0].shapes[0].circle_0);'])->circle([['latitude' =>
$response->getLatitude(), 'longitude' => $response->getLongitude()]],
['editable' => 'true','draggable' => true,'strokeColor' => '#000000',
'strokeOpacity' => 0.1, 'strokeWeight' => 3, 'fillColor' => '#FFFFFF',
'radius' => $radius]);
2016-07-27 15:06 GMT+01:00 Bradley Cornford [email protected]:
Have you run 'composer update cornford/googlmapper' ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgkVxQavq3OplbLjYJwrBiLNIkv7cks5qZ2XVgaJpZM4JVMmm
.
from googlmapper.
Try this:
$map = Mapper::map(
$response->getLatitude(),
$response->getLongitude(),
[
'zoom' => 16,
'draggable' => true,
'marker' => false,
'eventAfterLoad' => 'circleListener(maps[0].shapes[0].circle_0);'
]
)
->circle(
[
[
'latitude' => $response->getLatitude(),
'longitude' => $response->getLongitude()
]
],
[
'editable' => 'true',
'draggable' => true,
'strokeColor' => '#000000',
'strokeOpacity' => 0.1,
'strokeWeight' => 3,
'fillColor' => '#FFFFFF',
'radius' => $radius
]
);
from googlmapper.
i try it
but the javascript function does not react
2016-07-27 15:12 GMT+01:00 Bradley Cornford [email protected]:
Try this:
$map=Mapper::map( $response->getLatitude(), $response->getLongitude(), [ 'zoom' => 16, 'draggable' => true, 'marker' => false, 'eventAfterLoad' => 'circleListener(maps[0].shapes[0].circle_0);' ])->circle( [ [ 'latitude' => $response->getLatitude(), 'longitude' => $response->getLongitude() ] ], [ 'editable' => 'true', 'draggable' => true, 'strokeColor' => '#000000', 'strokeOpacity' => 0.1, 'strokeWeight' => 3, 'fillColor' => '#FFFFFF', 'radius' => $radius ]);
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgowNQjN3PPnCpZlT6ctxi6t4DWhmks5qZ2dqgaJpZM4JVMmm
.
from googlmapper.
when I change the radius or center on map nothing happens in
javascript function
2016-07-27 15:27 GMT+01:00 arouna perez [email protected]:
i try it
but the javascript function does not react2016-07-27 15:12 GMT+01:00 Bradley Cornford [email protected]:
Try this:
$map=Mapper::map( $response->getLatitude(), $response->getLongitude(), [ 'zoom' => 16, 'draggable' => true, 'marker' => false, 'eventAfterLoad' => 'circleListener(maps[0].shapes[0].circle_0);' ])->circle( [ [ 'latitude' => $response->getLatitude(), 'longitude' => $response->getLongitude() ] ], [ 'editable' => 'true', 'draggable' => true, 'strokeColor' => '#000000', 'strokeOpacity' => 0.1, 'strokeWeight' => 3, 'fillColor' => '#FFFFFF', 'radius' => $radius ]);
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgowNQjN3PPnCpZlT6ctxi6t4DWhmks5qZ2dqgaJpZM4JVMmm
.
from googlmapper.
I've just run the following, and it works as expected:
use Cornford\Googlmapper\Facades\MapperFacade as Mapper;
Route::get('/test', function () {
Mapper::map(
53.3,
-1.4,
[
'zoom' => 16,
'draggable' => true,
'marker' => false,
'eventAfterLoad' => 'circleListener(maps[0].shapes[0].circle_0);'
]
)
->circle(
[
[
'latitude' => 53.3,
'longitude' => -1.4
]
],
[
'editable' => true,
'draggable' => true,
'strokeColor' => '#000000',
'strokeOpacity' => 0.1,
'strokeWeight' => 3,
'fillColor' => '#FFFFFF',
'radius' => 100
]
);
print Mapper::render();
print "<script type='text/javascript'>
function circleListener(circle) {
circle.addListener('radius_changed', function()
{
console.log(circle.getRadius());
console.log(circle.getCenter().lat());
console.log(circle.getCenter().lng());
});
circle.addListener('center_changed', function()
{
console.log(circle.getRadius());
console.log(circle.getCenter().lat());
console.log(circle.getCenter().lng());
});
}
</script>";
});
And received this in console:
331.2584943954244
53.3
-1.3999999999999773
502.5610827158245
53.3
-1.3999999999999773
from googlmapper.
dit
Excuse me for disturbing you , when I move the circle on map or
change the raduis , the console does not display anything. i run
composer update this time.
2016-07-27 15:43 GMT+01:00 Bradley Cornford [email protected]:
I've just run the following, and it working as expected:
use \Cornford\Googlmapper\Facades\MapperFacade as Mapper;Route::get('/test', function () { Mapper::map( 53.3, -1.4, [ 'zoom' => 16, 'draggable' => true, 'marker' => false, 'eventAfterLoad' => 'circleListener(maps[0].shapes[0].circle_0);' ] ) ->circle( [ [ 'latitude' => 53.3, 'longitude' => -1.4 ] ], [ 'editable' => true, 'draggable' => true, 'strokeColor' => '#000000', 'strokeOpacity' => 0.1, 'strokeWeight' => 3, 'fillColor' => '#FFFFFF', 'radius' => 100 ] ); print Mapper::render(); print "<script type='text/javascript'> function circleListener(circle) { circle.addListener('radius_changed', function() { console.log(circle.getRadius()); console.log(circle.getCenter().lat()); console.log(circle.getCenter().lng()); }); circle.addListener('center_changed', function() { console.log(circle.getRadius()); console.log(circle.getCenter().lat()); console.log(circle.getCenter().lng()); }); } </script>";});
And received this in console:
/test:94 331.2584943954244
/test:95 53.3
/test:96 -1.3999999999999773
/test:94 502.5610827158245
/test:95 53.3
/test:96 -1.3999999999999773—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgklF7lGLefnjbP6FG3Nj575AIdb0ks5qZ26ZgaJpZM4JVMmm
.
from googlmapper.
Can you provide your composer.json, your controller method, and view please.
Just to confirm, does the map load?
from googlmapper.
yes the map load very well with circle
the problem it was i drag circle change radius or center the javascript
function does not show the new raduis or center it look like the event
"eventAfterLoad" does not respond
2016-07-27 18:25 GMT+01:00 Bradley Cornford [email protected]:
Can you provide your composer.json, your controller method, and view
please.Just to confirm, does the map load?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgjLMKXHrB87MqsYJ06cR0Bgj7NcAks5qZ5SIgaJpZM4JVMmm
.
from googlmapper.
Route::get('/testtest', function () {
Mapper::map(
53.3,
-1.4,
[
'zoom' => 16,
'draggable' => true,
'marker' => false,
'eventAfterLoad' =>
'circleListener(maps[0].shapes[0].circle_0);'
]
)
->circle(
[
[
'latitude' => 53.3,
'longitude' => -1.4
]
],
[
'editable' => true,
'draggable' => true,
'strokeColor' => '#000000',
'strokeOpacity' => 0.1,
'strokeWeight' => 3,
'fillColor' => '#FFFFFF',
'radius' => 100
]
);
print Mapper::render();
print "<script type='text/javascript'>
function circleListener(circle) {
circle.addListener('radius_changed', function()
{
console.log(circle.getRadius());
console.log(circle.getCenter().lat());
console.log(circle.getCenter().lng());
});
circle.addListener('center_changed', function()
{
console.log(circle.getRadius());
console.log(circle.getCenter().lat());
console.log(circle.getCenter().lng());
});
}
</script>";
});
2016-07-27 18:51 GMT+01:00 arouna perez [email protected]:
yes the map load very well with circle
the problem it was i drag circle change radius or center the javascript
function does not show the new raduis or center it look like the event
"eventAfterLoad" does not respond2016-07-27 18:25 GMT+01:00 Bradley Cornford [email protected]:
Can you provide your composer.json, your controller method, and view
please.Just to confirm, does the map load?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgjLMKXHrB87MqsYJ06cR0Bgj7NcAks5qZ5SIgaJpZM4JVMmm
.
from googlmapper.
What about your composer.json.
from googlmapper.
2016-07-27 19:06 GMT+01:00 Bradley Cornford [email protected]:
What about your composer.json.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgsO9DFekz3tBIb5t_lkP5gwhC8jjks5qZ54SgaJpZM4JVMmm
.
from googlmapper.
Which version of Laravel are you using? If its 5.* can you also run:
php artisan vendor:publish --provider="Cornford\\Googlmapper\\MapperServiceProvider"
If its 4.* can you also run:
composer update cornford/googlmapper
from googlmapper.
i use version 5.1
i already remove cornford googlImapper and install again,
it still does'nt work
2016-07-28 9:29 GMT+01:00 Bradley Cornford [email protected]:
Which version of Laravel are you using? If its 5.* can you also run:
php artisan vendor:publish --provider="Cornford\Googlmapper\MapperServiceProvider"
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgpyWv5dLZHpp9R9DCfoUlEW2jzWOks5qaGhjgaJpZM4JVMmm
.
from googlmapper.
Hello,
I always unable to retrieve the new coordinates of the circle when I
edit the circle on the map.
don't you have another solution for me please . I don't understand why
it does not work.
2016-07-28 12:06 GMT+01:00 arouna perez [email protected]:
i use version 5.1
i already remove cornford googlImapper and install again,
it still does'nt work2016-07-28 9:29 GMT+01:00 Bradley Cornford [email protected]:
Which version of Laravel are you using? If its 5.* can you also run:
php artisan vendor:publish --provider="Cornford\Googlmapper\MapperServiceProvider"
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgpyWv5dLZHpp9R9DCfoUlEW2jzWOks5qaGhjgaJpZM4JVMmm
.
from googlmapper.
Can you confirm you have run the following commands:
composer update cornford/googlmapper
php artisan vendor:publish --provider="Cornford\\Googlmapper\\MapperServiceProvider"
Also can you confirm the version of Googlmapper you are using.
from googlmapper.
thank you very much
the comand php artisan vendor:publish
--provider="Cornford\Googlmapper\MapperServiceProvider"
was'nt copy the views in the ressources folder. i have it manually do and
everything work now.
thank you again
2016-08-01 11:45 GMT+01:00 Bradley Cornford [email protected]:
Can you confirm you have run the following commands:
composer update cornford/googlemapper
php artisan vendor:publish --provider="Cornford\Googlmapper\MapperServiceProvider"—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgrfzaTBwE22DWFXg4kHVnhwavudkks5qbc5ggaJpZM4JVMmm
.
from googlmapper.
Did you receive an error when running the command?
from googlmapper.
yes the first time
the errors was in my config/compile.php
2016-08-01 12:42 GMT+01:00 Bradley Cornford [email protected]:
Did you receive an error when running the command?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmggjcIfTYRFnN8YSeKqXMHQ65cStgks5qbduUgaJpZM4JVMmm
.
from googlmapper.
hi bradley, i am working in another project
when i do print Mapper::render(); in my controller the map appear
but when i do {!! Mapper::render() !!} in view nothing appear
how can i fix it
2016-08-02 14:21 GMT+01:00 Bradley Cornford [email protected]:
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgpmmIWw6glOS83zc3KyobNmdItnXks5qb0Q9gaJpZM4JVMmm
.
from googlmapper.
sorry, it is work fine now
2016-08-03 14:44 GMT+01:00 arouna perez [email protected]:
hi bradley, i am working in another project
when i do print Mapper::render(); in my controller the map appear
but when i do {!! Mapper::render() !!} in view nothing appear
how can i fix it2016-08-02 14:21 GMT+01:00 Bradley Cornford [email protected]:
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APYmgpmmIWw6glOS83zc3KyobNmdItnXks5qb0Q9gaJpZM4JVMmm
.
from googlmapper.
Related Issues (20)
- Map Drag Event (Livewire) HOT 3
- Can you get lat/lng of clicked location? HOT 1
- Map not rendering when parent element is hidden HOT 1
- Map disappers when changing livewire model HOT 6
- gpx HOT 1
- Display KML/KMZ HOT 3
- Error Google Maps JavaScript API error: InvalidKeyMapError HOT 2
- Cornford\Googlmapper\Exceptions\MapperInstanceException No map found to add a polyline to. HOT 3
- Add new icon by click on the map view
- Drawing Layer (Library) HOT 1
- Laravel 9 support: illuminate/support v9.0? HOT 3
- Add listener 'click' on polyline ?
- DrawingManager Displayed twice based on React-18 upgrade HOT 1
- Re-rendering google
- eventClick on marker get Zoom
- Recenter Map With Livewire HOT 3
- labelClass doesnt work
- Bad Method Call Exception - Method Illuminate\Foundation\Application::share does not exist.
- Laravel 10 HOT 4
- Laravel 11
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 googlmapper.