takhamo123 / jquery-ui-map

Automatically exported from code.google.com/p/jquery-ui-map
0 stars 0 forks source link

Map not movable in rails application. Really strange problem... #60

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. This html example works properly. Map can be moved, zoomed etc.

<!DOCTYPE html>
<html>
<head>
<script src="http://maps.google.com/maps/api/js?sensor=true" 
type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" 
type="text/javascript"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js" 
type="text/javascript" ></script>
<script 
src="C:\Sites\MyApp\app\assets\javascripts\mobile\jquery.ui.map.full.min.js" 
type="text/javascript"></script>
</head>

<body>
<script>
$(function() {
$('#map_canvas').gmap();
});
</script>
<div id="map_canvas" style="width:250px;height:250px"></div>
</body>
</html>

2. But when I put this into my Ruby on Rails application:

<!DOCTYPE html>
<html>
<head>
<script src="http://maps.google.com/maps/api/js?sensor=true" 
type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" 
type="text/javascript"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js" 
type="text/javascript" ></script>
<script src="assets\mobile\jquery.ui.map.full.min.js" 
type="text/javascript"></script>
</head>

<body>
<script>
$(function() {
$('#map_canvas').gmap();
});
</script>
<div id="map_canvas" style="width:250px;height:250px"></div>
</body>
</html>

Map is not movable anymore. It's like static image. Every js file gets loaded 
and everything is all the same except "jquery.ui.map.full.min.js" filepath 
changes. That file is loaded properly in both cases and only difference is 
that, in Rails case that file has one extra blank line and one extra semicolon 
(;) in the end of the file.

What happens? Has someone else succeeded in combining jquery-ui-map plugin and 
ruby on rails? Any ideas what's causing this oddity?

What version of the product are you using? On what operating system?
jquery-ui-map-3.0-rc
Windows 7

Original issue reported on code.google.com by jesse.m....@gmail.com on 10 Aug 2012 at 10:10

GoogleCodeExporter commented 8 years ago
Problem seemed to be that, when I used "mobile browser" user agent, it blocked 
all the mouse events on the map. Seems to be that this wasn't a problem - 
rather feature couse mobile devices don't have mouse..

Original comment by jesse.m....@gmail.com on 10 Aug 2012 at 11:58