egeloen / ivory-google-map Goto Github PK
View Code? Open in Web Editor NEWGoogle Map API v3 integration for PHP 5.6+.
License: MIT License
Google Map API v3 integration for PHP 5.6+.
License: MIT License
When I set the bounds for the map like this:
$map = $this->get('ivory_google_map.map');
$map->setAutoZoom(true);
$map->setBound(new Coordinate(48.5, 12.1), new Coordinate(51.1, 18.9));
and output it in twig with
{{ google_map_container(map) }}
{{ google_map_js(map) }}
in the JavaScript output is e.g.
map_524188a66f2a3_container.coordinates.coordinate_524188a66fa73 = coordinate_524188a66fa73 = new google.maps.LatLng(48.5, 12.1, true);
map_524188a66f2a3_container.coordinates.coordinate_524188a66fa73 = coordinate_524188a66fa73 = new google.maps.LatLng(51.1, 18.9, true);
map_524188a66f2a3_container.bounds.bound_524188a66f2a3 = bound_524188a66f2a3 = new google.maps.LatLngBounds(coordinate_524188a66fa73, coordinate_524188a66fa73);
map_524188a66f2a3_container.map = map_524188a66f2a3 = new google.maps.Map(document.getElementById("map_canvas"), {"mapTypeId":google.maps.MapTypeId.ROADMAP});
map_524188a66f2a3.fitBounds(bound_524188a66f2a3);
i.e. both coordinates are named the same, which results in a bound that takes only the second (northeast) coordinate into account.
Is that a bug or I'm not following the docs right? Thanks!
EDIT:
I've actually noticed a very similar thing happens when adding multiple Markers. I had to give every coordinate and every marker a special JS prefix - is that a standard way to do it??
Catchable fatal error: Argument 1 passed to Ivory\GoogleMap\Helper\MapHelper::__construct() must be an instance of Ivory\GoogleMap\Helper\ApiHelper, instance of Ivory\GoogleMap\Helper\Base\CoordinateHelper given
it seems that the service ivory_google_map.helper.map, at map.xml, don't receive the first param
Hi @egeloen ,
I was wondering if there is a way to add google places librairie without hardcoding it in here
I need it for my websites to work, but I can't add google script alone as it raise a conflict. I need it to be declared just once
Is it planned? if yes when it will hit repository?
Hi,
How I can force use all http calls to google maps api use https protocol ?
I have the problem in markercluster images that calls:
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m1.png
and not with https..
Thanks
Response is displaying origin as destination and destination as origin.
File: ivory-google-map-master/src/Ivory/GoogleMap/Services/DistanceMatrix/DistanceMatrix.php
protected function buildDistanceMatrixResponse(\stdClass $distanceMatrixResponse)
{
$status = $distanceMatrixResponse->status;
$destinations = $distanceMatrixResponse->destination_addresses;
$origins = $distanceMatrixResponse->origin_addresses;
$rows = $this->buildDistanceMatrixRows($distanceMatrixResponse->rows);
return new DistanceMatrixResponse($status,$destinations,$origin,$rows);
}
Order of the return parameter is wrong when passing to DistanceMatrixResponse..
As I try to update with composer command "composer.phar update" after having replaced "krisswallsmith/buzz : "*" " by "widop/http-adapter: * " in my composer.json file, I get this error :
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "ivory_google_map.directions" has a dependency on a non-existen
t service "widop_http_adapter.curl".
I don't really figure what I have wrong in my code...
Thx.
wish we could set language option in GeocoderProvider as well. Instead of sending my pull-request, I'd like to briefly mention what i'd like to do here.
in GeocoderProvider's class
protected $language; // (1) added property for language option
public function __construct(HttpAdapterInterface $adapter, $locale = 'en')
{
parent::__construct($adapter, $locale);
$this->url = 'http://maps.googleapis.com/maps/api/geocode';
$this->https = false;
$this->format = 'json';
$this->language = $locale; // (2) save the language option
}
:
public function getGeocodedData($request)
{
if (is_string($request)) {
$geocoderRequest = new GeocoderRequest();
$geocoderRequest->setLanguage($this->language); // (3) set it accordingly
:
public function getReversedData(array $coordinates)
{
$request = new GeocoderRequest();
$request->setLanguage($this->language); // (4) same as above
:
Then, later, we could use the language option like
$map = new Map();
$map->setLanguage('ko'); // e.g. Korean
$geocoder = new Geocoder();
$geocoder->registerProviders(array(
new GeocoderProvider(new CurlHttpAdapter(), $map->getLanguage()),
));
What do you think???
[error] 10089#0: *532 FastCGI sent in stderr: "PHP message: PHP Fatal error: Call to a member function getJavascriptVariable() on a non-object in /proyectos/candgo/vendor/egeloen/google-map/src/Ivory/GoogleMap/Helper/MapHelper.php on line 1307
The maps libraries are already included on my pages, is it possible to disable the maphelper to output the jslibraries? I haven't seen a way to do it in the code..
I want to save the autocompleted address in an Entity whithin "my_field" attribute.
In its XXXType.php I've followed the doc and put this :
// ..
$builder
->add('my_field', 'places_autocomplete', array( 'prefix' => 'js_prefix_',
'types' => array(
AutocompleteType::CITIES,
),
'async' => false,
'language' => 'fr',
));
;
//..
"my_field" attribute's type is string. So when the form is submitted it tells me that the conversion from array to string is an issue.
Error : "Notice: Array to string conversion in C:\wamp\www\XXX\vendor\doctrine\dbal\lib\Doctrine\DBAL\Statement.php line 103"
It would be very nice to help me solve this problem.
In JsMarkerClusterHelper
the options are json encoded with the FORCE_OBJECT
parameter (https://github.com/egeloen/ivory-google-map/blob/master/src/Ivory/GoogleMap/Helper/Overlays/MarkerCluster/JsMarkerClusterHelper.php#L38)
This way custom styles cannot be configured as google expects an indexed array (not associative).
The styles option is rendered as "styles": {"0": {"key": "valye"}}
however "styles": [{"key": "value"}]
is expected.
Please fix in master (cant you use the JsonBuilder util?)
Roland,
AS per my requirement,i will have a origin as my start point and i have list of locations like L1,L2,L3,L4,L5,L6,L7 where i should drop my courier.
I need to find the best route for this scenario.
In this case i am not having propoer destinaltion point.
based upon the best route from google i will determine my destination.
Can one suggest me how to achieve this?
Last update, might have crashed it, becouse before it work's perfect, here it's the code generated by the render
map_515b04d0b779f_container = {"map":null,"coordinates":{},"bounds":{},"points":{},"sizes":{},"circles":{},"encoded_polylines":{},"ground_overlays":{},"polygons":{},"polylines":{},"rectangles":{},"info_windows":{},"marker_images":{},"marker_shapes":{},"markers":{},"kml_layers":{},"event_manager":{"dom_events":{},"dom_events_once":{},"events":{},"events_once":{}},"closable_info_windows":{}};
map_515b04d0b779f_container.coordinates.coordinate_515b04d0b6007 = coordinate_515b04d0b6007 = new google.maps.LatLng(39.300299, -2.856445, true);
map_515b04d0b779f_container.coordinates.coordinate_515b04d0bc189 = coordinate_515b04d0bc189 = new google.maps.LatLng(36.530533, -6.291897, false);
map_515b04d0b779f_container.coordinates.coordinate_515b04d0c6fb5 = coordinate_515b04d0c6fb5 = new google.maps.LatLng(40.452302, -3.687715, false);
map_515b04d0b779f_container.coordinates.coordinate_515b04d0c7521 = coordinate_515b04d0c7521 = new google.maps.LatLng(41.380485, 2.121590, false);
map_515b04d0b779f_container.coordinates.coordinate_515b04d0c7a64 = coordinate_515b04d0c7a64 = new google.maps.LatLng(40.423308, -3.672402, false);
map_515b04d0b779f_container.sizes.size_515b04d0bf5e9 = size_515b04d0bf5e9 = new google.maps.Size(1.1, 2.1, "px", "pt");
map_515b04d0b779f_container.sizes.size_515b04d0c71e3 = size_515b04d0c71e3 = new google.maps.Size(1.1, 2.1, "px", "pt");
map_515b04d0b779f_container.sizes.size_515b04d0c77bd = size_515b04d0c77bd = new google.maps.Size(1.1, 2.1, "px", "pt");
map_515b04d0b779f_container.sizes.size_515b04d0c7cf7 = size_515b04d0c7cf7 = new google.maps.Size(1.1, 2.1, "px", "pt");
map_515b04d0b779f_container.map = map_515b04d0b779f = new google.maps.Map(document.getElementById("map_canvas"), {"mapTypeId":google.maps.MapTypeId.ROADMAP,"zoom":5,"disableDefaultUI":false,"disableDoubleClickZoom":false});
map_515b04d0b779f.setCenter(coordinate_515b04d0b6007);
map_515b04d0b779f_container.info_windows.info_window_515b04d0bf4f5 = info_window_515b04d0bf4f5 = new google.maps.InfoWindow({"pixelOffset":size_515b04d0bf5e9,"content":"<h4>Carranza<\/h4><a href=\/poc-1-0\/>poc 1 0<\/a><br><a href=\/poc-1-0\/>poc 1 0<\/a><br><a href=\/poc-2-2\/>poc 2 2<\/a><br><a href=\/poc-2-2\/>poc 2 2<\/a><br><a href=\/poc-2-3\/>poc 2 3<\/a><br><a href=\/poc-2-3\/>poc 2 3<\/a><br><a href=\/poc-2-3\/>poc 2 3<\/a><br><a href=\/poc-3-2\/>poc 3 2<\/a><br>","open":false,"disableAutoPan":false,"zIndex":10});
map_515b04d0b779f_container.info_windows.info_window_515b04d0c712c = info_window_515b04d0c712c = new google.maps.InfoWindow({"pixelOffset":size_515b04d0c71e3,"content":"<h4>Estadio Santiago Bernab\u00e9u<\/h4><a href=\/poc-0-0\/>poc 0 0<\/a><br><a href=\/poc-2-0\/>poc 2 0<\/a><br><a href=\/poc-2-1\/>poc 2 1<\/a><br><a href=\/poc-3-1\/>poc 3 1<\/a><br><a href=\/poc-3-2\/>poc 3 2<\/a><br><a href=\/poc-3-3\/>poc 3 3<\/a><br><a href=\/poc-3-3\/>poc 3 3<\/a><br><a href=\/poc-3-3\/>poc 3 3<\/a><br><a href=\/poc-3-3\/>poc 3 3<\/a><br><a href=\/poc-0-1001\/>poc 0 1001<\/a><br>","open":false,"disableAutoPan":false,"zIndex":10});
map_515b04d0b779f_container.info_windows.info_window_515b04d0c76de = info_window_515b04d0c76de = new google.maps.InfoWindow({"pixelOffset":size_515b04d0c77bd,"content":"<h4>Estadio Nou Camp<\/h4><a href=\/poc-1-0\/>poc 1 0<\/a><br><a href=\/poc-1-0\/>poc 1 0<\/a><br><a href=\/poc-1-1\/>poc 1 1<\/a><br><a href=\/poc-1-2\/>poc 1 2<\/a><br><a href=\/poc-1-3\/>poc 1 3<\/a><br><a href=\/poc-2-0\/>poc 2 0<\/a><br><a href=\/poc-2-3\/>poc 2 3<\/a><br>","open":false,"disableAutoPan":false,"zIndex":10});
map_515b04d0b779f_container.info_windows.info_window_515b04d0c7c19 = info_window_515b04d0c7c19 = new google.maps.InfoWindow({"pixelOffset":size_515b04d0c7cf7,"content":"<h4>Palacio de Deportes<\/h4><a href=\/poc-0-1\/>poc 0 1<\/a><br><a href=\/poc-0-1\/>poc 0 1<\/a><br><a href=\/poc-0-2\/>poc 0 2<\/a><br><a href=\/poc-0-3\/>poc 0 3<\/a><br><a href=\/poc-1-1\/>poc 1 1<\/a><br><a href=\/poc-1-1\/>poc 1 1<\/a><br><a href=\/poc-1-3\/>poc 1 3<\/a><br><a href=\/poc-2-1\/>poc 2 1<\/a><br><a href=\/poc-2-2\/>poc 2 2<\/a><br><a href=\/poc-3-0\/>poc 3 0<\/a><br><a href=\/poc-3-2\/>poc 3 2<\/a><br><a href=\/poc-3-2\/>poc 3 2<\/a><br>","open":false,"disableAutoPan":false,"zIndex":10});
map_515b04d0b779f_container.closable_info_windows.info_window_515b04d0bf4f5 = info_window_515b04d0bf4f5;
map_515b04d0b779f_container.closable_info_windows.info_window_515b04d0c712c = info_window_515b04d0c712c;
map_515b04d0b779f_container.closable_info_windows.info_window_515b04d0c76de = info_window_515b04d0c76de;
map_515b04d0b779f_container.closable_info_windows.info_window_515b04d0c7c19 = info_window_515b04d0c7c19;
map_515b04d0b779f_container.markers.marker_515b04d0bc1f5 = marker_515b04d0bc1f5 = new google.maps.Marker({"map":map_515b04d0b779f,"position":coordinate_515b04d0bc189,"clickable":true,"flat":false});
map_515b04d0b779f_container.markers.marker_515b04d0c700f = marker_515b04d0c700f = new google.maps.Marker({"map":map_515b04d0b779f,"position":coordinate_515b04d0c6fb5,"clickable":true,"flat":false});
map_515b04d0b779f_container.markers.marker_515b04d0c7582 = marker_515b04d0c7582 = new google.maps.Marker({"map":map_515b04d0b779f,"position":coordinate_515b04d0c7521,"clickable":true,"flat":false});
map_515b04d0b779f_container.markers.marker_515b04d0c7ac3 = marker_515b04d0c7ac3 = new google.maps.Marker({"map":map_515b04d0b779f,"position":coordinate_515b04d0c7a64,"clickable":true,"flat":false});
map_515b04d0b779f_container.event_manager.events.marker_515b04d0bc1f5_info_window_event = marker_515b04d0bc1f5_info_window_event = google.maps.event.addListener(marker_515b04d0bc1f5, "click", function () {
for (var info_window in map_515b04d0b779f_container.closable_info_windows) {
map_515b04d0b779f_container.closable_info_windows[info_window].close();
}
info_window_515b04d0bf4f5.open(map_515b04d0b779f, marker_515b04d0bc1f5);
});
map_515b04d0b779f_container.event_manager.events.marker_515b04d0c700f_info_window_event = marker_515b04d0c700f_info_window_event = google.maps.event.addListener(marker_515b04d0c700f, "click", function () {
for (var info_window in map_515b04d0b779f_container.closable_info_windows) {
map_515b04d0b779f_container.closable_info_windows[info_window].close();
}
info_window_515b04d0c712c.open(map_515b04d0b779f, marker_515b04d0c700f);
});
map_515b04d0b779f_container.event_manager.events.marker_515b04d0c7582_info_window_event = marker_515b04d0c7582_info_window_event = google.maps.event.addListener(marker_515b04d0c7582, "click", function () {
for (var info_window in map_515b04d0b779f_container.closable_info_windows) {
map_515b04d0b779f_container.closable_info_windows[info_window].close();
}
info_window_515b04d0c76de.open(map_515b04d0b779f, marker_515b04d0c7582);
});
map_515b04d0b779f_container.event_manager.events.marker_515b04d0c7ac3_info_window_event = marker_515b04d0c7ac3_info_window_event = google.maps.event.addListener(marker_515b04d0c7ac3, "click", function () {
for (var info_window in map_515b04d0b779f_container.closable_info_windows) {
map_515b04d0b779f_container.closable_info_windows[info_window].close();
}
info_window_515b04d0c7c19.open(map_515b04d0b779f, marker_515b04d0c7ac3);
});
Just started using this library and it's really excellent, impressed with how well thought through and documented everything is. Great job!
I was wondering if you had any plans to add support for the Elevation API? I need it for the project I'm working on currently - if you aren't planning on adding it any time soon I will try and fork it and add it myself but just wanted to check it's not something you've already got in the pipeline, as it seems to be the only major service missing that I can see.
Many thanks for putting this together! Has saved me loads of time already.
I use the library as standalone and I to rendered a map the map doesn't work all the time, I mean that sometimes it's not working, and sometimes it's working (just in Chrome & Firefox - ironically it works perfect in Internet Explorer) when I inspect the element in Chrome (while the map is not working) it gives me this :
I am getting the following error while installing this component with Composer.
[Composer\Downloader\TransportException]
The "https://api.github.com/repos/symfony/PropertyAccess/zipball/2749512341
50e303c83099a2429be6be35629fe9" file could not be downloaded (HTTP/1.0 500
Internal Server Error)
And when I tried to put https://api.github.com/repos/symfony/PropertyAccess/zipball/2749512341 50e303c83099a2429be6be35629fe9
url in browser then also it shows Internal Server Error. I think in your composer.json
file should be updated for symfony/propertyaccess dependency module.
Thanks.
When i use the Geocoder tell me this errors, and i don't know if i'm doing anything wrong, i'm using the symfony bundle, but i don't have any idea, this is the code:
$geocoder = new Geocoder();
$geocoder->registerProviders(array(
new GeocoderProvider(new CurlHttpAdapter()),
));
// Geocode an address
$response = $geocoder->geocode('1600 Amphitheatre Parkway, Mountain View, CA');
Currently, the lib only supports native google map info window or IMO, we can provide an easy implementation which will not introduce BC and at the same time add a new feature: extension.
For the info box part, my point of view is simple: replace the InfoWinfowHelper
implementation by an other one. So, to enable the info box behavior, just need to instantiate the appropriate helper.
But now, if we generate info box objects instead of info windows, we need to load the info box library or an info window helper can not dot that... We're fucked...
Extension to the rescue! An extension will basically solve egeloen/IvoryGoogleMapBundle#82 by allowing to render custom libraires & add some custom code just before & after the generated code.
Then, we can create an InfoBoxExtension
which will load the library & then all should work for info box.
Hello,
I'd like to access the container from jquery.
I set the javascriptvariable to something so I don't have a uniqid in the container name.
But now I'd like to access the map. For example change the zoom level based on a user click on a button monitored by jQuery.
So I could do something like mymap_container.map.setZoom(12);
The container is wrapped into the function load_ivory_google_map() so I can't access it from jQuery.
Any tips would be great. Thx you.
Hi, i have the following problem when i try to add more than one marker on the map :
foreach($_aListVenues as $_oVenues){ $latitude = $_oVenues->venue->location->lat; $longitude = $_oVenues->venue->location->lng; $_aVenues = array( 'latitude' => $latitude, 'longitude' => $longitude, ); $_oMarker = $_oMap->createMarker($_aVenues); // create marker var_dump($_oMarker); $_oFinalMap->addMarker($_oMarker); // add marker on the map } var_dump($_oFinalMap->getMarkers());
The first var_dump display the marker as i want with different properties but the second display an array of exactly the same marker like that :
I've looked into the map class, the markers are added in an array, so why are they overriden when you add them ?
Like this: https://developers.google.com/maps/documentation/javascript/styling?csw=1
?
If not, where would something like this fit in the code?
The aim of all helpers is to generate javascript & lot of json. The json is all time generated using concatenation due to some string which are not json string but a reference to a variable or sometimes a function. So, I can't simply use json_encode...
IMO, the library should provide a json builder which allows to manage this part making all helpers much more readable & maintainable.
Hi,
for a project i need a places autocomplete field where the user can fill in his whole address. After submitting the form i want to seperate the address in fragments like zipcode, street, city, province etc. At the moment the autocomplete form field only returns the informationen as a string based on the given type. When i render the field with type = geocode, it only returns street + number, city and country.
Is there a way how to solve my problem? Maybe i need an additional geocode request to get the additional data?
Thank you.
Why not adding a legend feature ?
I've made a PR based on this tutorial :
https://developers.google.com/maps/tutorials/customizing/adding-a-legend
The Directions only supports the JSON format. As Google Map supports the XML one, we should support it too.
Hello there,
this is my first issue on Github, so forgive me please for my mistakes.
The bug appears when you provide origins or destinations which exceed max URL length provided by Google DistanceMatrix Webservice. Nowadays limit is set to ~2000 characters per request (after URL Encoding) - https://developers.google.com/maps/documentation/distancematrix/#Limits
Process method in DistanceMatrix class is not checking condition (length) of generated URL, method checks only responde of httpAdapter->getContent() method - which in this way returns HTML, but that HTML is Google error page with status code 400.
Can I provide pull request to fix that?
Hello,
I'd like to override the google-bundle which generates the js cause I'd like to rewrite it in jQuery for the need of my projet.
Can you tell me how to do it without touching the vendor bundle ?
I tried to extend googlemapbundle in my Application/Ivory/GoogleMapBundle but I'm not able to hook the Helper/TemplateHelper for example.
Can you give me some tips ?
Current implementation does not support transit travel mode.
TravelModes
TransitDetails
Google Maps seems to support GeoJSON as a layer now as well. Are there any plans of supporting this as well?
I can't see any option to set the property maxWidth on infoWindows. My infoWindows are rendered too small and displays scrollbars.
Any idea ?
As someone who is starting to use this in a rather large code-base I'd like to clarify a few points:
The MarkerImage
has been deprecated in the google map library and we should use Icon
instead. The library should provide a BC layer.
This problems happens if map loading when on load moment he is inside invisible DOM element. I don't find solution for reload map.
Possible solution:
{{ google_map_js(map) }} - generated script like this:
<script type="text/javascript">...</script>
If this part can be changed to:
<script type="text/javascript">
function init_map_MAPID() {
...
}
init_map_MAPID();
</script>
or something like this, than map can be reloaded when needed with generated function call.
The Geocoder provider only supports the JSON format. As Google Map supports the XML one, we should support it too.
If you would like zoom map with kmlLayer probably you must add :
$kmlLayer->setOption('preserveViewport',true);
It's correct ?
Hi!
I have an issue - I've installed the bundle, and tried to render it, but the map doesn't show.
This is my controller's code:
namespace My\WebApp\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Ivory\GoogleMap\Map;
class MapController extends Controller
{
public function indexAction()
{
$array = array();
$map = new Map();
$array["map"] = $map;
return $this->render('MyWebApp:map.html.twig', $array);
}
}
The view generates the Map canvas DIV, but there's no map.
What am I doing wrong?
I'm using IvoryGoogleMapBundle 2.1 with bounds that should fit marker extends but it's not working.
I tried to investigate the issue and it seems that JavaScript map.fitBounds(bound) should be called after all extends are added to bound object. For now this line is added by MapHelper::renderMapBound method which is called from MapHelper::renderJsContainerMap before MapHelper::renderJsContainerBoundsExtends which adds marker extends is called.
I tried calling fitBounds() after all extends are added and it worked perfectly.
Thanks in advance.
I'm trying to use ivory-google-map with laravel4.
when i try to use it, it return : No Provider Registred.
To test this, i've added
use Ivory\GoogleMap\Services\Geocoding\Geocoder;
$geocoder = new Geocoder();
var_dump($geocoder->geocode($input));
And i think there is an error in documentation :
use Ivory\GoogleMap\Services\Geocoding\Geocoder;
use $geocoder = new Geocoder();
This is a var_dump($geocoder) :
object(Ivory\GoogleMap\Services\Geocoding\Geocoder)#343 (4) {
["providers":"Geocoder\Geocoder":private]=>
array(0) {
}
["provider":"Geocoder\Geocoder":private]=>
NULL
["resultFactory":"Geocoder\Geocoder":private]=>
object(Geocoder\Result\DefaultResultFactory)#344 (0) {
}
["maxResults":"Geocoder\Geocoder":private]=>
int(5)
}
The Distance Matrix only supports the JSON format. As Google Map supports the XML one, we should support it too.
In AbstractJavascriptVariableAsset you can set $javascriptVariable in constructor.
Unfortunately, you cannot do the same in Map.php constructor.
It would be nice to get the opportunity to pass the same $javascriptVariable to Map.php constructor (that would need to call parent::__construct), so you can fix $javascriptVariable and avoid a random value (useful for caching purposes)
Hi,
I'm having some trouble with the polygons. The code I use:
$polygon = new Polygon();
$polygon->setOption('fillColor', '#000000');
$polygon->setOption('fillOpacity', 0.5);
$polygon->addCoordinate(52.058718160173306, 4.19677734375, false);
$polygon->addCoordinate(52.04668422583484, 4.208278656005859, false);
$polygon->addCoordinate(52.04457267508014, 4.203472137451172, false);
$polygon->addCoordinate(52.03433023856411, 4.211540222167969, false);
$polygon->addCoordinate(52.03327418382684, 4.204845428466797, false);
$polygon->addCoordinate(52.02767667726934, 4.2084503173828125, false);
$polygon->addCoordinate(52.02926094833158, 4.221153259277344, false);
$polygon->addCoordinate(52.06162059770389, 4.270763397216797, false);
$polygon->addCoordinate(52.06225383173855, 4.259519577026367, false);
$polygon->addCoordinate(52.06061795878833, 4.254884719848633, false);
$polygon->addCoordinate(52.06283428838372, 4.251537322998047, false);
$polygon->addCoordinate(52.06499774214766, 4.252138137817383, false);
$polygon->addCoordinate(52.066897273678855, 4.247074127197266, false);
$polygon->addCoordinate(52.06879672441445, 4.2510223388671875, false);
$polygon->addCoordinate(52.07074885347869, 4.2496490478515625, false);
$polygon->addCoordinate(52.07444183716456, 4.252738952636719, false);
$polygon->addCoordinate(52.07607720377737, 4.251623153686523, false);
$polygon->addCoordinate(52.07233159817613, 4.241323471069336, false);
$polygon->addCoordinate(52.0805609662022, 4.232568740844727, false);
$polygon->addCoordinate(52.05887647981069, 4.1974639892578125, false);
Notice the big empty space. When zooming in, more spaces arise. Any idea how to get rid of them? I already tried setting the no-wrap
to true.
The Map
object becomes to large imho. All helpers are composed 1 on 1 which doesn't seem very flexible if a new helper is added.
How about $map->getHelper('marker')
or $map->getHelperManager()->get('marker')
?
Hello,
I'm using this bundle through https://github.com/egeloen/IvoryGoogleMapBundle and all was OK up to a few days
When using the distance API, I got this error :
Error: Call to a member function getStatusCode() on a non-object in /my/path/vendor/egeloen/google-map/src/Services/AbstractService.php line 259
When adding a var_dump at this line, of $response
:
https://github.com/egeloen/ivory-google-map/blob/master/src/Services/AbstractService.php#L254
the results is :
string(523) "{ "destination_addresses" : [ "Strasbourg, France" ], "origin_addresses" : [ "Illkirch, France" ], "rows" : [ { "elements" : [ { "distance" : { "text" : "13,6 km", "value" : 13590 }, "duration" : { "text" : "18 minutes", "value" : 1087 }, "status" : "OK" } ] } ], "status" : "OK" } "
Hi i install this Bundle and try use in form but without succes :
(in sonata admin)
// src/Miejsce/ObiektyBundle/Admin/ObiektyAdmin.php
use Ivory\GoogleMap\Places\AutocompleteType;
..
protected function configureFormFields(FormMapper $formMapper)
->add('adres','places_autocomplete')
but have :
Could not load type "places_autocomplete" in site - how to use it ?
Is there a way to have both a map with markers etc as well as an autocomplete places form on the same page? I can get either one to work but not together.
I get "Uncaught TypeError: undefined is not a function" which is probably due to a collision. I see the '<script type="text/javascript" src="//www.google.com/jsapi?callback=load_ivory_google_map_api"></script>' is in there twice and a function "function load_ivory_google_map_api ()" is declared twice with different content.
I am using the following on the page:
{{ $autocompleteHelper->renderJavascripts($autocomplete) }}
{{ $mapHelper->renderJavascripts($map) }}
{{}} are Laravel's blade echo statements.
I am using this in a Laravel project via composer ("egeloen/google-map": "1.4.*@dev")
How I can setup default param map configuration in config.yml file,
like ZoomControl (Zoomcontrolstyle ControlPosition) etc..
foreach($entity as $e) {
$marker = $this->get('ivory_google_map.marker');
$marker->setPosition($e->getLatitude(),$e->getLongitude(),true);
$infoWindow = new InfoWindow();
$infoWindow->setAutoOpen(true);
$infoWindow->setAutoClose(false);
if($e->getId() == 1) {
$infoWindow->setOpen(true);
}
else{
$infoWindow->setOpen(false);
}
$marker->setInfoWindow($infoWindow);
$map->addMarker($marker);
...
It dosn't work... Why ?
Hello,
First of all I would like to say thank you for great library!
But I have some problems. I am using this library to show map for each registered user. But in all user list only one map is showing.
This is my method:
public function findCompaniesAction() {
$em = $this->getDoctrine()->getManager();
$companies = $em->createQueryBuilder()
->select('b')
->from('RFQIronilBundle:User', 'b')
->where('b.acc_type = 1')
->getQuery()
->getResult();
foreach ($companies as $key => $company) {
$map = $this->get('ivory_google_map.map');
$map->setMapOption('mapTypeId', MapTypeId::ROADMAP);
$map->setMapOption('mapTypeId', 'roadmap');
$company->map = $map;
}
return $this->render('RFQIronilBundle:Default:find-companies.html.twig', array(
'companies' => $companies
));
}
and in my view I use:
{% for companies in companies %}
{{ google_map_container(companies.map) }}
{{ google_map_js(companies.map) }}
{% endfor %}
All is fine, but map is showing for only first user. What I have missed?
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.