Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay elements (image/view) on map #11

Closed
amjd opened this issue Jan 22, 2016 · 1 comment
Closed

Overlay elements (image/view) on map #11

amjd opened this issue Jan 22, 2016 · 1 comment

Comments

@amjd
Copy link

amjd commented Jan 22, 2016

Can we overlay an image (e.g., a location marker fixed at the center) or a view (e.g., text field or search bar) on top of the map?

I tried something like this, but the elements within the <maps:mapView> tags didn't show at all:

<maps:mapView id="map" latitude="12.85" longitude="77.66" mapReady="onMapReady">
    <SearchBar hint="Enter an address..." id="search" keyboardType="text" />
</maps:mapView>
@dapriett
Copy link
Owner

You can't add Nativescript view elements directly into the mapView. Use Nativescript layouts like below, to position Nativescript elements over the map.

<Page xmlns="http://www.nativescript.org/tns.xsd" xmlns:maps="nativescript-google-maps-sdk" loaded="pageLoaded">
    <GridLayout >
        <maps:mapView  id="map" latitude="12.85" longitude="77.66" mapReady="onMapReady"/>
        <GridLayout rows="auto">
            <SearchBar hint="Enter an address..." id="search" keyboardType="text" style="background-color: white; margin: 10;" />
        </GridLayout>
    </GridLayout>
</Page>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants