Comments (14)
You can not put any images or buttons over the map, because the map places above the web view (HTML layer). I have been considering this feature request, but not find any better way.
from cordova-plugin-googlemaps.
@wf9a5m75 Could you please try and find a way to do this? I think it's a common feature that will be requested by many users. For example, in my application I need to be able to add a custom control that functions in its own way.
With the Google Maps JavaScript API I could do this simply by creating an absolute element, positioning it above the map canvas, and then adding an event handler to the element.
I think this is something that needs to be possible in the plugin, or at least a way to add custom controls.
I have a sidebar in my application and when I try to move the map-canvas
div that the map is in it just stays still. Is there a way to get around this? If I want to move the map-canvas
div around do I have to call setDiv()
every single time? If this is the case it means that no movement can be animated in terms of moving the map around the page as you have to call the method every time.
Without this sort of functionality every app that uses the plugin is restricted to a single screen. Really we need the application to sit inside of the div so it can be moved around like you would expect.
from cordova-plugin-googlemaps.
@jskidd3
Execute map.refreshLayout() after moving the map-canvas
div.
from cordova-plugin-googlemaps.
I'd like to see something similar. Ideally, I want a marker always positioned in the center of the map (i.e. what the Uber app does). Right now, I move the marker when the camera moves, but it feels odd since the marker doesn't move while the map is dragging.
What about doing something like:
http://stackoverflow.com/questions/8098874/how-to-display-fixed-postion-overlay-in-mapview
Thanks!
from cordova-plugin-googlemaps.
This is implemented in v1.2.0. V1.2.0 is going to release in September.
from cordova-plugin-googlemaps.
Please try the new version of the plugin.
This problem should be fixed. (I tested many times)
https://plus.google.com/112861993350247152906/posts/ber5LChbWkU
from cordova-plugin-googlemaps.
Is this documented, I am using plugin v1.2.5, but I unable to find how to implement this?
from cordova-plugin-googlemaps.
Hey !
Is there a new way as of now to keep a marker fixed to the center of the map ?
Thank you,
from cordova-plugin-googlemaps.
Using the plugin v2, you should be able to do with this:
map.on(plugin.google.maps.event.CAMERA_MOVE, function(cameraPosition) {
marker.setPosition(cameraPosition.target);
});
from cordova-plugin-googlemaps.
Hey Masashi,
Thank you for your answer. This is how I do it now; however, there's a slight delay between the map moving and the marker staying in the center. This is what I'm looking to correct...
from cordova-plugin-googlemaps.
Or put an image in the map div.
<div id="map" style="position: relative">
<img src="marker.img" style="position: absolute; left:50%;top:50%;" />
</div>
from cordova-plugin-googlemaps.
Hello Masahi,
I have used your fix and it has been working perfectly. However, multiple users have alerted me about a problem. When elements are overlayed on top of the map, dragging those elements causes the map to scroll.
The detail of the bug can be found here :
https://forum.ionicframework.com/t/elements-on-top-of-google-map-scroll-bug/114692
Would anyone know if there's a way to prevent that from happening ?
Thank you very much.
from cordova-plugin-googlemaps.
How about this?
<div id="map" style="position: relative">
<img id="centerMarker" src="marker.img" style="position: absolute; left:50%;top:50%;" />
</div>
var centerMarker = document.getElementById("centerMarker");
centerMarker.addEventListener("touchstart", function(e) {
e.preventDefault();
});
from cordova-plugin-googlemaps.
Drag map while keeping marker at the center
from cordova-plugin-googlemaps.
Related Issues (20)
- Automatically get the center of the map and place a marker?
- Any fork that is being maintained? HOT 2
- iPad Orientation issue with Google Maps plugin MyPluginLayer
- warning: google.maps.event.addDomListener() is deprecated, use the standard addEventListener()
- Zoom controls not responding
- Google Maps app is not installed or disabled error HOT 1
- CSS injection problem in all project pages.
- Use tileOverlay from Zoom Level 14 in higher Zoom levels
- Support for latest Android and iOS Versions HOT 17
- Googlemaps is not installed or not ready yet HOT 1
- Clean project cordova 11, only gray background no map loaded inside div HOT 3
- Android app crash on LocationService .getMyLocation()
- Huawei with no Google Services Issue
- Map does not load on Android : CordovaGoogleMaps.traceDomTree
- Build Error: Could not find com.android.volley:volley:1.1.1.
- Cordova iOS 7.0.1 'cordova/CDVCommandDelegateImpl.h' file not found HOT 14
- Installing iOS error HOT 1
- BSF Cordova Ecosystem Crowdfunding Plan
- cordova-plugin-googlemaps, map showing a blank screen. Ionic Cordova Angular HOT 4
- Unable to load custom image for map marker "There is no file at '//private/var/containers/Bundle/Application/F14E3528-E405-44D6-81AA-91C752E927E5/DOT%20Appname.app/www/img/city-driver-icon-1.png'."
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 cordova-plugin-googlemaps.