It's going to be difficult to assist unless you show us your view code. Use the pastebin (link in the navbar) if necessary.
What Andrew said. In general, yes, it's 100% possible to embed map in a Laravel view (no problems with Blade or anything).
This line...
map = new google.maps.Map(document.getElementById('map-canvas'),
Means it is going to put the map into an element with an ID of "map-canvas", you don't appear to have an element (i.e. a DIV in your page with this ID, so the map has nowhere to go.
See https://developers.google.com/maps/documentation/javascript/tutorial#Map_DOM_Elements
yes, I know that but my problem is like that
http://forumsarchive.laravel.io/viewtopic.php?id=16247
This problem have any solution ?
So, have you created a DIV with an ID of map-canvas? Have you set a height and width on it?
yes, set
#<style>
#map-canvas {
height: 50%;
margin: 0px;
padding: 0px
}
</style>
this is what I'm doing and not work.
I'm doing wrong?
this is the example I want to do but I need to use blade
https://developers.google.com/maps/documentation/javascript/examples/map-simple?hl=en
Your code works fine for me, provided I give the the map-canvas div a real height. You're using a % height, which will only have any meaning if the parent div has a non-zero height.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community